Automatic HockeyApp/TestFlight Upload XCode Script
If you’ve ever want to distribute your iOS app to beta testers, reviewers or investors, you know how painful it is.
Usually when there’s pain, there’s a Business opportunity. Indeed. You can now use services such as TestFlight & HockeyApp to automate the process of distributing AdHoc builds.
But it’s still cumbersome to manually upload builds.
Thankfully both services have an API so it’s just a matter of writing a script and hook it up inside XCode.
- Fist off, if you work with a team, make sure to “share” your target scheme.
- Second, Edit Scheme and add a Pre-Action Run Script to Build. This will increment the CFBundleVersion in your plist when you make an adhoc build. This ensures that all builds uploaded to TestFlight or HockeyApp have a different version (They use a combination of you CFBundleShortVersionString and CFBundleVersion). [This script assumes that you created an adhoc configuration with "Adhoc" in its name]
Here’s the script.
- Then, select Archive and choose the adhoc build configuration you created.
- Then add a Post-Action Run script to Archive. [Make sure to select your target in "Provide Build Settings from"]
Here’s the script. Make sure to update your API keys and select the service you want using theĀ UPLOAD_SERVICE variable.
Enjoy!
-s





