Here are some notes on how to build an ad hoc distribution and deploy your app onto another iOS device.
Overview
Deploying your application onto other iOS devices is non-trivial to say the least. Apple has done it’s best to document how it all works, but I found it extremely confusing and convoluted. So don’t feel you are alone if you are struggling.
There are two configuration steps we need to go through when creating an ad hoc distribution.
First we need to create something called a distribution via the iOS Provisioning Portal. Then we need to import that provision into XCode and use it as part of our build.
Note: I am not sure if this is required but some tutorials I’ve seen say you need an icon for your app. So to be save you may want to add one.
iOS Provisioning Portal
Register device(s)
First thing we need to do is register any devices we want to deploy our app onto. This part is actually pretty easy and this link shows you how to do it:
https://developer.apple.com/ios/manage/devices/howto.action
Create ad hoc provision
Here’s an example of what provisioning profiles look like (these I created).
There are two types of deployments you can make. Ad hoc or App store. Ad hoc is like a test deploy. You just want to make a build, and deploy it onto someone elses machine.
App store is self explanatory. Many of the steps we are doing here for ad hoc you can repeat for app store (just different selections in configuration).
Provisioning profiles are how apple tracks who can run your app, and on which devices. Here we want create a new ad hoc provision profile call Ad Hoc.
Here we just choose an App ID and then add any devices at the bottom you would like to include in the profile.
Deploy provision into XCode
Now that you’ve got a Ad Hoc provision setup, you need to get it into your XCode for a build.
Easiest way to do this is do download the provision you just created (if it says pending click another tab and come back once it’s enabled).
Then open XCode, and drag it onto the XCode docking icon at the bottom.
You can verify the provision distribution was imported by going Window -> Organizer clicking the ‘Devices’ tab and then the ‘Provisioning Profile’ section on the left.
Now we are done with the iOS Provisioning Portal and can switch to XCode.
XCode 4
Create a new configuration
Click on the project keyword, then your project, and then the ‘Info’ tab.
Then under ‘Configurations’ click the + sign and duplicate the ‘Release’ Configuration.
Setup your Target
Now we need to configure our Target (the thing below the blue project) so that the new configuration we just created uses the ad hoc provision we just created in the iOS Provision Portal.
Click the target for your app (just below your blue project keyword). Then find the ‘Ad Hoc Distribution’ we just created in XCode and point it to the ‘Ad Hoc’ provision distribution we created via the portal.
Setup your archive
Here we need to setup our archive build step so that it uses the ‘Ad Hoc Distribution’ we just created and configured in XCode.
Create the archive
Product -> Archive
If everything goes well you should see the archive like this:
Create the ipa
Highlighting the archive we just created click ‘Distribute’ and then choose the type of distribution you’d like to create (‘Ad Hoc’ in our case).
Click through the last couple menus then voila! You should have an ipa you can distribute to your friends.
Import via iTunes
Email or send the ipa to your friends and tell them to simply double click the ipa (which will open iTunes) and then sync with there device.
They should now have your app on their device.
Don’t give up
If these instructions don’t work for you don’t give up.
I struggled mightily to get ad hoc deploys going so if this works for you first time through consider yourself very lucky.
For the rest of us keep fighting and googling. Hopefully this tutorial will help.
Links that help
http://www.musicalgeometry.com/?p=1237
https://developer.apple.com/ios/manage/overview/index.action
Updating iOS application – this bundle is invalid error « The Agile Warrior
Apr 10, 2012 @ 13:48:22
Updating iOS application – this bundle is invalid error | t1u
Apr 10, 2012 @ 14:30:43
Updating iOS application – this bundle is invalid error « CSS Tips
Apr 10, 2012 @ 14:31:06
Updating iOS application – this bundle is invalid error « w3z.info
Apr 10, 2012 @ 14:31:55
Leander
Oct 18, 2012 @ 10:31:58
One step is not clear: when making the ipa I am asked to sign the package again. Which certificate to use for that?
It seems whatever I do, my particular ipa just will not run.
JR
Oct 18, 2012 @ 17:28:04
Getting your app distributed in an adhoc fashion on another device has become a rite of passage unfortunately in iOS.
It’s painful, complex, and it never just works.
Congrats on getting it going. I hope Apple makes this easier for us in the future.
Cheers – Jonathan
leander
Oct 18, 2012 @ 13:02:25
Three days of fighting with no result.
Then I get it runing on the first try on another iPhone.
So maybe the UDID is wrong? Nope, because I did get another app to run on that device.
O well, I have a test version running, so moving on…
How to distribute ad hoc build with XCode 4 & MAKE IPA FILE | kamanijaydeep
Oct 05, 2013 @ 10:40:45
CopyQuery | Question & Answer Tool for your Technical Queries
Oct 07, 2013 @ 07:18:54
Evers
Mar 01, 2014 @ 23:01:36
THANKS!!! After struggling for hours I found your blog and it was fixed in a couple of minutes!
liliakoto2
Jun 28, 2014 @ 10:47:50
oh god i’v spent so much time on this. It’s finally working thanks to your post
thanks JR
如何使用Xcode创建.ipa文件?|ios问答
Nov 11, 2020 @ 15:22:54
Xcode를 사용하여 .ipa 파일을 만드는 방법은 무엇입니까? 실제 iPhone에서 사용하는 전체 절차를 알려주세요. - IT HOW
Oct 21, 2021 @ 20:34:30
[Ios] How to create .ipa file using Xcode? - Pixorix
Jun 02, 2023 @ 13:43:11
[xcode] Xcode를 사용하여 .ipa 파일을 만드는 방법은 무엇입니까? - 리뷰나라
Aug 05, 2023 @ 07:06:51