Sometimes we need a quick and easy solution to automate our distribution to TestFlight. You may want to create a script that we can manually run or add it to a git hook after each commitment.
Generally, there are many enterprise solutions to automate our distribution to TestFlight, but sometimes we want something we can easily adjust and understand.
We can use the
xcodebuild utility to automate App Store Connect deployment with the following command (Fix the parameters to match project settings)
$ xcodebuild-exportArchive-archivePath $ PWD / build / myApp.xcarchive -exportOptionsPlist exportOptions.plist -exportPath $ PWD / build
exportOptions.plist file includes
destination field with value
upload which automatically uploads it to App Store Connect. It looks like this:
method app store destination upload
You can add that command to your script and upload your app to App Store Connect and follow up the usual test flow for TestFlight.
If you are interested in automatically updating the
build number, you can check a small script I created called xcibversion -https: //github.com/rderik/xcibversion. I have also documented other steps to automate App Store Connect deployment in the following posts: https://rderik.com/blog/automating-build-and-testflight-upload-for-simple-ios-apps/ebrit19659002??I hope this helps. And if you have any other tips on how to automate the distribution task, share them with me, feedback is also welcome.