Tag: Testflight
Setting up an Automated Build in an iOS environment – part 5
by George on Jun.19, 2011, under Coding, Project Management
I’ve recently been trying out Testflight as a method for getting beta builds out to testers. Testflight handles a number of things for you – over the air distribution of builds, notification e-mails, download stats and more. It’s a great system, but my first thought when I started experimenting with it was: “Can I incorporate it into my build system?” Fortunately the answer is yes, in fact it’s dead easy. Let’s see how it’s done…
Setting up…
I won’t go into all the details of setting up a Testflight account, it’s fairly well covered on the site. What you will need to do is set up one or more ‘teams’ for beta testing. Once you’ve done this, it’s time to investigate Testflight’s upload API.
Automated uploading
Most pages on the Testflight site have a set of links at the bottom, one of which is ‘Upload API’. This page gives details of how you can upload a build programmatically. You’ll need to find a few details – an api token and a team token. Both of these can be found by following links off the Upload API page. Once you’ve got these, we can use curl to handle the communication with Testflight .com:
curl http://testflightapp.com/api/builds.json -F file=@yourapp.ipa -F api_token='your_api_token' -F team_token='your_team_token' -F notes='This build was uploaded via the upload API' -F notify=True -F distribution_lists='Your Team Name'
And that’s all there is to it! I’d recommend trying this from the command line until you’re happy that builds are uploading correctly, then simply drop this command line into your build system as a final build step.
I’ve been using this for a while and it works well. The first time you create a build, your testers receive an email – if they read the email on their device, they’ll get instructions for setting up Testflight on their iDevice. Having done this once it becomes a one click process for testers to get new builds. Not only that, but you as the team leader will know who has downloaded the build, and on what device!
Just a few of issues…
Overall I’m really happy with Testflight as a system. There are some things to be aware of though:
- Testflight only works on newer devices / OS versions (4.0 and later, I believe).
- I’m not clever enough to interpret the results of curl to determine if an upload fails, so currently I get a ‘build succeeded’ even if the upload fails. If anyone can offer some advice on how to do this, I’d appreciate it.
I hope you find this useful – I know I do – one click to go from Source Control to having a new build in tester’s hands? Magic.