Last Updated: November 19, 2020
·
32.54K
· anthonylevings

Creating an iTunes ipa file for ad hoc distribution in 30 steps (Xcode for iOS)

The first thing you'll need for ad hoc distribution through Xcode is membership to the Apple developer programme and a valid iOS Distribution certificate. To view this certificate you need to:

  1. navigate to the Organizer in Xcode and click on the Devices tab
  2. select the name of your team from the left sidebar

If you don't see any certificates there with green ticks, then you need to go to the iOS Provisioning Portal in the Apple developer site. Once here:

  1. click on Certificates from the left side bar in your web browser and select the Distribution tab within this area
  2. if you have a certificate that isn't valid (most likely because you didn't copy it from another machine into your keychain), then you'll have to either copy the certificate and key to your new machine from the old one or revoke the old certificate and create a new one
  3. if there's no certificate then simply create one
  4. once you have a certificate you should be able to refresh Xcode inside the Team tab and the certificate will appear.

Once your distribution certificate is in place:

  1. go to the Provisioning option in the provisioning portal sidebar on the web
  2. click on the Distribution tab
  3. click New Profile
  4. select Ad Hoc for the Distribution method
  5. give your profile a name, it doesn't matter what it is
  6. next you'll need to supply your App ID, you can either use your iOS Wildcard or create an App ID in the provisioning portal that can be used here. (Note: if you choose to create an App ID then the bundle identifier you use in the provisioning portal will need to be the same as the one used in the Target summary for your app in Xcode.)
  7. underneath the App ID you will see a list of devices, these are either added by the devices having been plugged into Xcode or added through the provisioning portal - for which you'll need the device's UDID number and the owner's email address - tick the ones you want to be able to use the app you're distributing

Now return to Xcode

  1. within the Devices tab of the Organizer select from the left sidebar under Library "Provisioning Profiles"
  2. click the Refresh button and having supplied your developer account log-in details you should see the distribution certificate appear

Now to assign this profile to your project's build settings:

  1. select your Project's Info Settings add a configuration and call it "AdHoc"
  2. select the icon under Targets and go to the Code Signing section and change the AdHoc entry's settings to the name of the Provisioning Profile you created

Now to build the ipa:

  1. without your device plugged in, choose to Run your app on the iOS Device (from the pull down menu next to the stop button) BUT don't press Run
  2. from the Product menu (OS X menu bar) select Edit Scheme ...
  3. select Archive from the dialog box sidebar
  4. select your AdHoc Build Configuration from the drop down menu and then click OK
  5. go to the Product menu again and select Archive and then press OK

Once the archive process is complete you should automatically be taken to the Organizer Archives tab in Xcode. From here:

  1. Click Distrbute..
  2. Select "Distribute for Enterprise or Ad-Hoc Deployment"
  3. Press Next
  4. The Code Signing Identity that you need should already be selected but if not look for the name of your team underneath the correct iOS Distribution Provisioning Profile and select this (it should have the word "iOS Distribution" in brackets after your team name)
  5. click Next and it will ask you the name and location on your system where you wish to place the file

All is now finally ready, but you need one last thing:

  1. click on Devices tab in Organizer
  2. select Provisioning Profiles from the sidebar and highlight the one you've used for the app, then export the certificate
  3. send this mobile provisioning certificate with the app, since the person installing the app will need to drag the ipa and the mobile provisioning certificate into iTunes before syncing.

Original blogpost:

http://sketchytech.blogspot.com/2012/12/creating-itunes-ipa-file-for-ad-hoc.html

Related protips:

Installing Xcode Command Line Tools on OS X Mavericks

1 Response
Add your response

Hi,
this tutorial is outdated but it still comes up in searches,
please update it or remove it,
very first step is wrong, 'navigate to the Organizer in Xcode and click on the Devices tab' xcode 9 does not have Device tab in the Organizer.

over 1 year ago ·