Continuous Delivery of iOS apps using Jenkins and TestFlightApp


May 21, 2012

As mentioned in earlier posts we’ve been doing Continuous Delivery for both Webapps and Android apps for quite sometime. This post is about setting up Continuous Delivery for iOS apps using Jenkins and TestFlightApp. TestFlightApp is a free service which helps to do closed beta testing without putting into AppStore. Using their APIs, the process of delivering new versions of the app can be automated.

Setting up Continuous Delivery mainly involves the following steps:

Lets see those steps in detail.

Setup Mac Machine as Jenkins Node**

Setting up a node with Jenkins is very easy . You can either control the slave using SSH or using JWS. Each node will have a label name associated with it, which needs to be mentioned during setting up the job which needs to be run on this node. You can configure the nodes from the Manage Nodes under the Manage Jenkins option. The following screenshot shows how to configure a node using SSH.

Configure Node using SSH

This link contains step by step instructions on how to configure a node using JavaWebStart.

Setup Jenkins Xcode plugin

Jenkins XCode plugin abstracts the xcode commands to run for creating packages for distribution. Jenkins Wiki has details about how to configure the same. I encountered one issue while configuring the same, i.e. ipa generation was failing when the “Build output directory” was configured with relative path. It got resolved by giving the full path as ${WORKSPACE}/build.

Configure Distribution profile

For distributing applications, an ad-hoc distribution profile needs to be created using the this link. The Development Provisioning Profile will not work with TestFlightApp. It took me sometime to figure out the same. The following video gives detailed instructions on how to create the same.

Integrate with TestFlightApp API

TestFlightApp provides API which can be integrated with Jenkins to upload the IPA after successful build. I used curl command, as given as sample in the document, to upload the IPA. You can create support groups to be notified on each new upload of the app, and installation of the app is very simple i.e. just a click of link in the email. No iTunes and no sharing of IPA through emails.

One issue I was stuck during the setup was the configuration of the profile with the Xcode plugin. The plugin has the option “Embed Profile”, but even if you give the path of the profile file, it was using the wrong profile for the IPA. The problem resolved when the profiles were refreshed in Xcode. You can get the Refresh option in the Organizer menu as shown below.

Refresh profiles - Xcode

Note: This post is mainly about integrating Jenkins with TestflightApp, hence not talking about testing tools. I am planning to cover about the same in my upcoming posts.