The organizer window in Xcode has a handy feature where all the versions of applications you have submitted to the App Store are listed.
Today I needed to install an old version of an app to my iPhone in order to reproduce an issue a customer was having. It wasn’t as easy as I was expecting so I thought it was worth recording the process. Essentially you cannot simply copy the archived app to your device manually, as it was signed using the App Store certificate. We need to re-sign it using an Ad Hoc certificate instead - then it’ll run.
First up you need to make sure that you have an Ad Hoc distribution certificate handy, and that said certificate includes the device that you’re trying to distribute to.
UPDATE: August 2012: This process is far easier if you use this free open-source app called iResign. This great app lets you take an existing IPA and re-sign it with your own certificate. Much, much simpler
Ignore this part if you already have an Ad Hoc distribution certificate.
- Get your team agent to log into the iOS provisioning portal
- Go to provisioning / distribution tab
- Hit New Profile
- Choose ‘Ad Hoc’ as the distribution method
- Choose the relevant app ID (I chose an app id that allows any application by Calvium)
- Select the devices you want to be able to run on. I just chose all by selecting the select all button.
- Hit ok. Wait a minute or so, and hit refresh to be sure that the certificate is ready.
- Go back to Xcode organizer. Open the ‘archived application’ section and choose the app you want to use.
- On the right-hand panel, choose the version to use. I’ve chosen 1.2. Apologies for the censorship in the images here..
- Click Share
- Click the ‘identity’ drop-down and under the heading ‘Ad Hoc Distribution’, select ‘iPhone Distribution’
- Now click ‘Save to Disk’
- Choose a filename (doesn’t matter what it is)
- Xcode will grind away for a bit re-signing the app, and then save a .ipa file containing the app.
There are various ways of installing the ipa on the device, including via iTunes. I find this method by far the easiest - no syncing required.
- Open Xcode organizer again
- Attach the device
- Open the ‘Devices’ section, and select the device
- Under the Applications box, click the + arrow.
- Select the .ipa file you just saved, and lo and behold the app will be installed
- If it fails with an ‘no provisioning profile found’ or ‘invalid entitlements’ or similar, check that the ‘Provisioning’ box above contains the Ad Hoc profile you created earlier. If not, download it from the iOS provisioning portal, and manually upload it by clicking the + button under provisioning.
xcode 7 now lets you sign the ipa during the export process when the archive is first converted to an ipa. I was pleasantly surprised at how easy it was, since usually doing anything with xcode, especially signing, is not.
ReplyDelete