Distribute Ad Hoc Applications Over the Air (OTA)
Note: The information below is specific to Xcode 3.x (Xcode 4 was not available when the post was written).
If you’ve been through the distribution process of an Ad Hoc application, you can appreciate the challenges of getting a build installed on someone’s device. From the differences of working with users on Windows versus Mac machines, to explaining how to import an Ad Hoc provisioning file and the associated build into iTunes, this process is anything but a walk in the park.
In this post I’ll take you through the steps of deploying Ad Hoc builds over-the-air, where users simply point the Safari web-browser (on their iPhone) to a link and tap to install the provisioning file and associated application.
Provisioning Profile
To begin, create a provisioning profile like you would for any other Ad Hoc build. In the image below you’ll notice I created a profile named AdHocOTAProfile and associated this with the app id AdHocOTA.

Once the profile is created, download onto your location machine and drag/drop the file onto the Xcode icon, this will install the provisioning file into the following folder: ~/Library/MobileDevice/Provisioning Profiles. The image below is a screenshot of the profile path on my machine – notice the provisioning file name is no longer the nice readable name that was written to your file system when you downloaded the file, this is to be expected.

From within Xcode, you can now associate this provisioning profile with your build. In the Target settings, select the Build tab, in the Code Signing section choose the new Provisioning Profile you created:

Xcode Build and Archive
Once you have a working project within Xcode (with the Code Signing identity set as mentioned above), make sure that you set the build type to Device.

From the Build menu in Xcode, choose Build and Archive (if this option is not highlighted, make sure you’ve selected Device in the build settings.

Once the build is complete, the Organizer window will appear – make sure the Archived Applications section is selected on the left panel.

In the figure above, I’ve updated the Name of the app to AdHoc OTA Test, this is optional, as well as any comments you would like to include.
Click on the Share button, and a new dialog will appear similar to that shown below:

From the Identity dropdown, select the Provisioning Profile created earlier:

Now choose Distribute for Enterprise – fill in the URL to the location where you plan to host the application. Note that you must include the fullpath to the application, including the name of the .ipa file that you plan to use:

At this point, don’t worry about the image files, I believe those are applicable only if you are doing an OTA deployment through an Enterprise developer account (internal app distribution for corporations). Update: Seems there may be a little more to how the images are used beyond Enterprise deployments, see the comments section for more information.
Once you select Ok, you will be prompted for a filename to save the build, verify that you use the same name as you specified in the URL:

At this point ipa and plist files will be created for you, the provisioning file will be embedded within the ipa.
OTA HTML File
With the build complete, we know need to create a very simple webpage that will allow users to find the application on a web-server.
The html below is as about as bare-bones as we can get, it’s nothing more than a link to the file, with a specific href for itms-services which Safari will recognize and initiate the download/install process when clicked.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>OTA Test App</title>
</head>
<body>
<ul>
<li><a href="itms-services://?action=download-manifest&url=http://3SixtySoftware.com/OTAtest/AdHocOTATest.plist"> Tap Here to Install the Application</a>
</li>
</ul>
</body> </html>Important: – Replace the path shown above with the path to where you will upload the ipa and plist files that Xcode created.
Save the html file with the extension .html
Upload To Web-Server
We’re getting close – at this point we are ready to upload the ipa, plist and html files. The figure below shows the directory listing on the web-server where I uploaded the files:

Install the iPhone Application OTA
To download the application via OTA, start your web-browser and point it to the link where the html file lives. Once loaded you should see a screen similar to the figure below:

Tap on the link and a dialog will appear asking if you would like to install the Ad Hoc application:

If all works as expected, at this point you can send a link to the html file to anyone you included in the provisioning file and they can install the application OTA.
Related posts:
- A Valid Provisioning Profile For This Executable Was Not Found
- Touch or Untouch a File in Xcode
- Download and Install Older Versions of Xcode (Xcode Previous Releases)



I’ve been using TestFlight to automate some of the process. Works great
[Reply]
Bill Reply:
May 12th, 2011 at 1:21 pm
Me too. TestFlight has made it possible for my non-tech-savvy friends-with-iPhones to participate in my beta…
[Reply]
There is also Diawi which is a free online tool to deploy your development iOS applications directly to your devices using iOS 4 wireless app distribution mode.
You just need to upload your .ipa to get an install url that will work directly on your iOS devices :)
[Reply]
Hi John,
The image file is useful because it is displayed by itunes in the list of apps on your phone. If someone installs ota, and then syncs with iTunes, the icon will be missing.
[Reply]
Thanks!
[Reply]
Don’t forget to generate the entitlements file to proceed adHoc distribution.
If you don’t, the app download but fail during the install :)
[Reply]
Jude Reply:
December 10th, 2011 at 10:16 pm
What is the entitlement file and how is it generated.
[Reply]
John Muchow Reply:
December 11th, 2011 at 9:17 am
Jude, I would recommend you look at the Apple docs related to deployment, the entitlement file and how to create is described in more detail.
[Reply]
Just used this to get my app out today to the staff.
Many thanks.
[Reply]
Does this method require iOS Enterprise Program or iOS Developer Program – Individual is enough?
And if iOS Developer Program – Individual is enough, is there any easy way to easy update deployed apps?
[Reply]
John Muchow Reply:
March 18th, 2011 at 8:58 am
This deployment process can be used for the Individual Developer, Enterprise is not required.
[Reply]
Nitin Reply:
May 5th, 2011 at 3:23 pm
I believe, if the bundleid and product name haven’t changed, and the bundle version and the CFBundleVersion short numbers are higher than the ones that are deployed, its should update the deployed apps. (I am not 100% sure about it though)
[Reply]
Anybody else find that this no longer works on ipad version 4.3 of IOS? Worked on 4.2.
[Reply]
alex n Reply:
March 25th, 2011 at 11:38 am
Yep, the icon would suddenly disappear after install. It’ll pop up again as soon as you restart your device. I’m trying to find a solution for this.
[Reply]
marco Reply:
April 7th, 2011 at 4:17 am
Hi Alex, did you manage to find a solution for the icon disappearing on ios 4.3?
[Reply]
alex n Reply:
April 7th, 2011 at 10:22 am
Actually, I did.
It turns out to be that the bundle-identifier in my manifest.plist file did not match the adhoc provisioning profile identifier. This property has to match the APP ID in the provisioning portal that you created the profile with.
i.e. My APP ID = com.TheApp.*
WRONG:
bundle-identifier
com.SomeOtherName.Whatever
CORRECT:
bundle-identifier
com.TheApp.TheAppName
Also, make sure that you replace ‘TheAppName’ with the same value as ‘Product Name’ in your project + target settings.
Daniel Rosenstark (yar) Reply:
May 2nd, 2011 at 7:46 pm
@alex n, thanks SO much for commenting that the properties need to line up (and they didn’t before). This saved me today.
[Reply]
Alex Nguyen Reply:
May 2nd, 2011 at 8:46 pm
@Daniel
Glad my problems lent you a hand!
developer Reply:
April 6th, 2011 at 3:36 am
Hi,
I tried this tutorial, but i am not able to share using “Distribution for Enterprise.”? Does anyone tried this.
I am preparing iPad application with iOS 4.2.
Thanks in advance.
[Reply]
John Muchow Reply:
April 6th, 2011 at 8:28 am
Hmmm, are you using Xcode 4 (I haven’t tried this with this release version 4)?
[Reply]
Great article. I’ll try this on my next ad hoc build. I can’t tell you the number of GotoMeetings I’ve had to do to get ad hoc builds installed on a client’s phone/ipad.
[Reply]
I used it this morning and it worked like a champ. Just a reminder that if you are using a Windows server you have to set the MIME types on the server. By default IIS will block a .plist and an .ipa file.
This is a going to save a ton of time. Great article.
[Reply]
Jackie Reply:
February 7th, 2012 at 10:24 am
@Dave Gruen – Thanks SO much for this tip. I’ve been racking my brain over this all morning. I created the file association on the server, and matched the MIME exactly in IIS, and it works like a charm. Thank goodness for forums. Take care :)
[Reply]
I’m trying to follow the steps but when clicking on “Distribution for Enterprise.” the dialogs just disappears and no form is displayed…
I’m using XCode 3.2.5, should I upgrade to 4 ?
Before selecting the “Distribution for Enterprise.” option on the right I see and activity indicator with the legend “Getting identity information…” and never stops till I press the options.
After pressing the option another legend is displayed but to fast to be able to read it… :S
I have the certificates and the provisioning profile as always do for adhoc distributions.
Any idea?
[Reply]
Federico Reply:
May 6th, 2011 at 9:13 pm
Finally it worked with XCode 4
[Reply]
Federico Reply:
May 13th, 2011 at 8:41 pm
I think this fix had to do with the setting to YES of “Skip Install” Deployment property in the included static library by the project, but not sure… https://devforums.apple.com/thread/86137
[Reply]
Thanks for great tutorial. I have a question, how many device can be installed the application distribute by OTA?
[Reply]
John Muchow Reply:
May 27th, 2011 at 8:32 pm
For Adhoc I assume the limit is 100 (as with the traditional approach), I don’t know if there is a limit for Enterprise accounts
[Reply]
Hi All,
On choosing Distribute for Enterprise window to enter the URL does not appear..
What causes this issue?
Thanks
Merlyn
[Reply]
Federico Reply:
June 23rd, 2011 at 7:32 am
I had the same problem. After trying with XCode 4, then tried back again with XCode 3 and it worked, maybe XCode 4 did modify some setting in the project related with the problem.
More info at my May 13th, 2011 at 8:41 pm comment.
Hope it helps!
[Reply]
asrar Reply:
June 28th, 2011 at 8:53 pm
Same issue here. I downloaded and installed XCode 4. It worked with XCode 4, and now also works for XCode 3.
[Reply]
Hey,
Managed to solve the error.
Added the entry value “$(SDKROOT)/ResourceRules.plist” for Code signing resource rule path.
I came to this conclusion by creating the *.ipa for the application using command line. The error indicated that Resource file could not be read.
command Used:
/usr/bin/xcrun -sdk iphoneos PackageApplication -v “${PROJECT_BUILDDIR}/${APPLICATION_NAME}.app” -o “${BUILD_HISTORY_DIR}/${APPLICATION_NAME}.ipa” –sign “${DEVELOPPER_NAME}” –embed “${PROVISONNING_PROFILE}”
Thanks
Merlyn
[Reply]
Thanks for this. I’ve been trying to get my office colleagues to help out with testing and user experience and it was a major pain in the butt to have to get their phone and manually install it.
[Reply]
Great article. It works very well.
Thanks,
Juliana
[Reply]
Great article….It helped me a lot
Thanks
Sravan Alluri
[Reply]
sravan Reply:
August 18th, 2011 at 8:26 am
Thanks to “Dave Gruen” for telling to set mime types…it helped me a lot
Thanks
Sravan Alluri
[Reply]
Great article. I have some questions.
Is that means I can distribute and sell my app to users using this OTA method in my web site instead of App Store?
Besides that, does this work for non-jailbreak iPhone?
Thanks.
Rachel
[Reply]
John Muchow Reply:
August 29th, 2011 at 4:40 pm
This is only an alternative means to distribute Ad Hoc builds, it is not a substitute for the App store. There are the same limits as before, up to 100 devices.
[Reply]
godlaugh Reply:
September 3rd, 2011 at 1:59 am
One of my colleague install myApp ad-hoc distribution wireless successfully,but he didn’t register his device UDID in my ad-hoc.mobileporvision,I am very curious about that yesterday,how could that happend?
But today I understand,because his iPod Touch has been jailbeaked!!!
even so, Ad Hoc Distribution OTA is very simple and convenient for both jailbreaked or not jailbreaked device to test your app.
And now I understand the ad-hoc distribution is limit to 100 devices. Thank you!
[Reply]
If this really works you are my hero!
[Reply]
Hi,
I have found one of the wierded issue in my programming career using this distribution method.
I can create and sign archive, upload to server, download and install app successfully. But when I run the application first time, it doesnot support rotation at all. Everything works fine in portrait mode though.
If I kill the application and re-run the application, it works fine. Also if I re-install the application without un-installing, it works fine.
Any idea why?
Your help will be very much appriciated.
Thanks
Nitin
[Reply]
John Muchow Reply:
September 2nd, 2011 at 11:22 am
This seems more like a problem with the application than the distribution method. You may also want to try other approaches to getting the app on a device to see if the same issues are present. For example, load the app via Xcode and load using “traditional” adhoc distribution with iTunes.
[Reply]
Nitin Reply:
September 2nd, 2011 at 11:26 am
Thanks for your quick reply.
With Xcode, it works great without any issue.
The surprising thing is – if I install again using same archive, it works fine. But on first attempt – no rotation support.
Can you think of any steps I am missing?
Nitin
[Reply]
Worked for me, thanks.
[Reply]
How to install any application more than 100 ipad using ad hoc?
I watched this kind of applications which is installed on any ipad through URL, Please let me know if you have any solution?
Regard
Pravin
[Reply]
Its is awesome.
Tanks Keep doing the great work Buddy…………………..
Thanks once again………………
[Reply]
Bummer its not working for me. At the point it gets to ‘installing’ it gives up and says it cannot install the app at this time. The app installs fine when the device is directly connected to Xcode and signed using a traditional adhoc distribution provision.
I noticed you create and sign with a regular developer provision rather than an adhoc distribution one. Was that an oversight in the article or does that really work??
[Reply]
@Doug — I’m running into the same issue as well. Were you able to resolve it?
[Reply]
Doug Reply:
December 2nd, 2011 at 7:19 am
Yes. Amazingly yes. So with iOS 5 and Xcode 4.2 this all works.
First the preamble:
1. in organizer I removed my ad hoc profile.
2. Then in the iOS portal I made sure all the devices I wanted were checked and re-downloaded the profile.
3. Then I dragged and dropped the newly downloaded profile into the organizer window and saw that it was happy with it.
Now what I think made it work:
1. Bring up your project’s info section in Xcode where it shows your deployment target and configurations. Delete your ad hoc configuration (I had one and I assume you do to as I think this is the problem).
2. Click on the “+” and select “Duplicate Release” and call it your ad-hoc guy.
3. Move over to build settings and down where you pick code signing locate your newly created build config.
4. Pick ‘iPhone distribution” the generic one.
5. Edit your Xcode scheme and click on the archive guy. Change his build config to be your ad hoc config.
And the ending:
1. Archive.
2. In organizer, share for enterprise. I left the signing alone (generic iPhone distribution, did not locate the specific ad hoc guy).
I have made several beta releases and my beta testers have it work. Its flat out awesome to do it this way. Why don’t they make a bigger deal about this on the dev portal?
Hey, post back if it helped! Id like to know that was my problem.
[Reply]
Worked!
[Reply]
I got it.
Skip Install set to YES for dependencies, here is the link: http://stackoverflow.com/questions/5265292/xcode-4-create-ipa-file-instead-of-xcarchive/9238070#9238070
And then went to Coreplot-CocoaTouch, which is dependence of my project targets. Then went to Coreplot-CocoaTouch Targets. In Targets opened Build Phases. Then opened Copy Headers. There I had some of headers in Public, some in Private and some in Project. Moved ALL of them to Project.
Of course, in Build Settings of Coreplot-CocoaTouch Targets checked that Skip Install was set to YES in Deployment options.
And this time Archive made an archive that could be signed and .ipa produced.
[Reply]
Hi,
I’m following your instructions but when I click on “install” on my device I get the error message:
“AppOTA” could not be downloaded at this time.
I don’t know if I’m missing something. Some step.
You don’t mention distribution profile, just developer (I’m a newbie so nothing is obvious to me yet). I understand from what I read that since I have xCode 4.3 and iOS 5 app I don’t need that Entitlement file. I can’t find where to created it anyway.
I don’t have any third party library so I’m not setting the skip install value.
You also don’t mention anything about editing the scheme and change “Release” to “Ad Hoc”. I’ve seen that in other instructions so I’m not sure if I should do that.
I’m totally lost here. Any help would be greatly appreciated.
Thanks in advanced,
Juan.
[Reply]
bg Reply:
March 21st, 2012 at 10:12 am
right, you can set up the scheme for archiving, it is a copy of your release scheme, basically you could use release instead, just make sure you use correct developers profile – the one that you create for OTA distributions!
So were you able do produce signed .ipa package from your archive?
If you did then check the names and url you used while saving for Enterprise Distribution.
B
[Reply]
Has anyone managed to use Apple Configurator for enterptise apps?
Everytime I try I keep getting a message “Can’t install” “Invalid app identifier”
It works fine instead if I install apps downloaded from ITunes
I read somewhere it needs to add a developer provisioning profile to the settings, but did not find info on how to do this.
Any help will be greatly appreciated.
[Reply]
Remarkable issues here. I’m very satisfied to see your post. Thank you so much.
[Reply]