I spent more time trying to get Ad Hoc distribution work than any other issue that should have taken 15 minutes. There are a number of things which can go wrong, some of which are ridiculous and Apple will no doubt fix in time, but for now you should know these:
The biggest gotcha: you can not use the “Compress” option in Finder to bundle the Ad Hoc package. It adds files that cause iTunes to freak out. I wrote a quick shell script to bundle everything up and zip it together using the command line zip tool.
mkdir Payload cp -rp MyApplication.app Payload/ zip -r MyApplication.ipa iTunesArtwork Payload
This way, you can give people the .ipa and .mobileprovision file. Tell them to drag the .mobileprovision into iTunes, and then double click the .ipa. How easy was that?
Another semi-obscure fact: iTunesArtWork is a 512×512 png, named simply ‘iTunesArtwork’ without the extension that needs to be included ONLY with Ad Hoc copies so the icon shows up in the iTunes window. You don’t need to include it, but if you do make sure you only do so when sending out Ad Hoc copies.
One more thing that caught me over and over again: don’t forget to increment the version number in your info.plist file before giving Ad Hoc users a new copy! iTunes is really sneaky about what happens here…in both cases it says the application is already installed, and asks if you want to replace it, but if you try to replace with the same or lower version number, it won’t actually do anything.
If you are getting
Application was not installed on the iPhone because it could not be verified.
then your profile isn’t valid and you should check out this post. This biggest thing to remember is
- Delete all the profiles stored in
~/Library/MobileDevice/Provisioning Profile. - Double click your .mobileprovision file and it will get loaded into XCode.
- Quit XCode completely. I’m not sure why this is necessary, but often XCode refuses to build unless it starts up with the profile already ready.
Lastly, ensure not only that Entitlements.plist is included in your project (click File, New File, Code Signing, Entitlements), and that get-task-allow is unchecked, but in your “Ad Hoc” build profile (Project, Edit Active Target) expand the list to “All Settings” make sure the “Code Signing Entitlements” field is filled out with your “Entitlements.plist”.
Comments
Leave a comment Trackback