Automating Over The Air Deployment for iPhone
Since the release of the iOS4 we are able to distribute iPhone applications “Over The Air” (i.e: directly downloading the application from the iPhone without using iTunes).
This greatly simplifies the deployment process especially for entreprises where iTunes is rarely a corporate tool. It also allows you to create your own enterprise App Store.
But until now it was a fully manual process : not anymore !
In this article we’ll see how to automate the deployment with a software factory, thus making the deployment more reliable and more productive.
The missing command line :
Over the air deployment is based on a new command in the build menu of Xcode called “build and archive” which packages the application with an embedded provisioning profile.
There have been many questions on how to integrate this feature in a continuous integration process.
The “xcodebuild” command is well known : it builds an Xcode project from the command line and generates an “.app” file.
You can use this command to build your application from a script ran by a software factory.
But the generated file cannot be distributed over the air since it misses the embedded provisioning profile.
We need to build the project into an “.ipa” file, containing the provisioning profile and signed with your developper identity.
To be able to find the command line, the trick was to watch the system console log while running a “build and archive” through Xcode. You will then see something similar to this :
Console log extract :
31/10/10 20:57:16 Xcode Running /usr/bin/xcrun with (
“iPhone Developer: M VINCENT DAUBRY (J9TS3TJRYX)”,
Writing the script :
You can now run a script which will :
- Build your application into an .app file
- Package it into an .ipa file
Here is a sample build script.
EDIT: June 13th, 2012
Since this article has been published, the industrialization of iOS development has been improved. Specially with the release of the XCode plugin for Jenkins.
One year ago, OCTO launched the Appaloosa service, the private store service to help our teams, our customers and anybody who needs to go further with the Over-The-Air distribution of their private apps.
Appaloosa provides its own Jenkins plugin to automatically deploy the latest version of an application to the private store.