When you are writing an iOS app and have beta testers you need a method to update their devices with your latest release. Running around with a laptop and a cable will get old very fast. There are a few commercial solutions that I am sure work well, but this method is free and fairly painless.
This post is a recapitulation of several posts already available on the web (see here, here, and especially here ) but I wanted to put all the details in one place updated for the latest changes to XCode Menu names and using Github Releases. Much of this information can also be found in Apple's Documentation. This link may be useful:
The basis tasks are:
- Create an adhoc profile on the Apple developer site including each beta testers device id. This creates a .mobileprovision file.
- Create an Archive for your application. This creates a plist file and[A] an .ipa file.
- Post all three files on the internet (or an intranet). You can use Github Releases.
- Create a simple HTML file (see this link for the original source of this idea http://jeffreysambells.com/2010/06/22/ios-wireless-app-distribution) that the users will navigate to on their device. The HTML file will contain a link that will allow them to install the latest version of your app.
Now the details:
Step 1, Hang out on the Apple Developer site for a while
I won't pretend to have a solid fundamental understanding of Apple's certificate/provisioning/profile setup/mess, but for this task you definitely need to create an Adhoc Provisioning Profile. This falls into the Distribution category of profiles (as opposed to Development). I am going to list what worked for me circa November 2013.
- Go to the "Certificates, Identifiers & Profiles" section of the Apple Developer site.
- You need a Distribution Certificate for this task. Create one under "Certificates -> Production".
- Register all your beta tester's iOS devices in the "Devices" section. You will need each device's UDID. You can get this by plugging the device into your Mac and opening up the Organizer in XCode (intuitively hidden under "Windows -> Organizer").
- You need an App ID. I believe since your app is not actually going into the App Store yet you can get away with using a wild card App ID. Create this under the "Identifiers" section of the website.
- Create your Adhoc Provisioning Profile under "Provisioning Profiles -> Distribution". You will need to associate your Distribution Certificate, App ID, and each beta tester's device with the profile. Unfortunately this does mean you will need to generate a new one of these each time you want to add a new beta tester. I guess this is one of the reasons this method is free.
- You will now have a file with the .mobileprovision extension.
Step 3 Archive your App
In XCode, make sure you have "iOS device" selected in the toolbar at the top (the dropdown where you choose which device to run your App on, or which simulator). Click "Product -> Archive". Once that succeeds, follow the instructions in step 2 thru 6 here. You will need to enter the URL where you intend to place the bundle for your users to download. This is because to install your application on their device, users will actually download a .plist file (created in this step), that links to the actual location of your app. As I go into detail below, I put these files on Github Releases, so the location would be something like
You will get a .plist file and a .ipa file.
Step 4 & 5 Put these files somewhere your users can access them and create an HTML page that links to your plist
You can put these files anywhere you want, as long as people will be able to download them. Thanks to a suggestion from mitalia, I put these on our internal Github using the Releases functionality. You can also use public Github. You just create a release, and attach all three files as binary attachments and Github will store them for you.
You can just post the .mobileprovision file directly on Github releases. A word of caution, I have no idea what the ramifications are of posting a provisioning profile on the public internet are, it might be advisable to make the Github repository private, or post this file elsewhere. The link that Github Releases automatically generates for files you bundle with your release will work. Just tell your users to click the link on their iOS device, and it will prompt them to install the provisioning profile on the device. Unfortunately, for installing the app itself you need a little more control over the HTML anchor element, so you need to create an HTML file that contains the properly formatted link. This post provides a template HTML index file you can use (and a nice PHP script that makes this simpler if you are not using Github Releases), but effectively you just need to create an HTML page with a link constructed as follows that your users will click on:
<a href="itms-services://?action=download-manifest&url=LINK_TO_YOUR_PLIST_FILE">Click to install</a>
Again, you can post this HTML file anywhere. I actually just upload it to Github Releases the same way I upload the other files. The users will see a link to the HTML file in the attachments portion of the Release. In a normal browser clicking the link would result in downloading the file to the machine because Github Release sets the link as "nofollow", but in the file system averse iOS, Safari will render the HTML as if the user just clicked on a normal link. They then click the link to your PLIST and will be prompted to install your app.
You can then create a new release or update this one as you need users to update the app. They will only need to install the provisioning profile once.
Thanks for reading, please leave any comments or corrections.