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

en:Mallet and Chisels | Janekpfeifer


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:

(3) click on Certificates from the left side bar in your web browser and select the Distribution tab within this area
(4) 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
(5) if there's no certificate then simply create one
(6) 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:

(7) go to the Provisioning option in the provisioning portal sidebar on the web
(8) click on the Distribution tab
(9) click New Profile
(10) select Ad Hoc for the Distribution method
(11) give your profile a name, it doesn't matter what it is
(12) 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.)
(13) 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


(14) within the Devices tab of the Organizer select from the left sidebar under Library "Provisioning Profiles"
(15) 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:

(16) select your Project's Info Settings add a configuration and call it "AdHoc"
(17) 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:

(18) 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
(19) from the Product menu (OS X menu bar) select Edit Scheme ...
(20) select Archive from the dialog box sidebar
(21) select your AdHoc Build Configuration from the drop down menu and then click OK
(22) 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:

(23) Click Distrbute..
(24) Select "Distribute for Enterprise or Ad-Hoc Deployment"
(25) Press Next
(26) 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)
(27) 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:

(28) click on Devices tab in Organizer
(29) select Provisioning Profiles from the sidebar and highlight the one you've used for the app, then export the certificate
(30) 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.

Comments

  1. Hello.
    I wanna build ipa files for my projects but I this isn't work.
    How can I hack Xcode?

    Xcode version: 5.0.2

    ReplyDelete
  2. How far through the process have you managed to get?

    ReplyDelete

Post a Comment