List/Guideline for creating Ad Hoc/Distribution Build for iPhone

I feel that peoples are very interested to know, how they can submit there application to apple store. So I am writing more in this domain to help those peoples.

So I am going to list down all the important things you need to make Ad Hoc build for iPhone. Using Ad-Hoc build you can run/test your code in your iPhone. You can send that build to client’s as well but you should know their UUID. Its very easy to get UUID of iPhone by plug-in iPhone and checked “Identifier” in Summary tab from iTunese.


Before Starting development you need following things:

  1. You need a Mac machine ( but I have seen people using Windows for iPhone development)
  2. You need a developer License (in most cases 99$ is more then enough for companies too)
  3. In most cases you need to have iPhone/iPhone touch, to test your application(some times you can just believe on simulator too.)

For Design of your application, I found few PSD’s which might help you as well ( 320×480 psd & iPhone GUI ).

After testing your code on simulator you need following things to run your application on iPhone:

  1. You have to create a certificate(developer/distribution) on iPhone developer portal which is little tricky task. But let me help you create a certificate ( I am going to copy most of the things form developer portal):
    • In your Mac machine, go to Applications folder, open the Utilities folder and launch Keychain Access.
    • In the Preferences menu, set Online Certificate Status Protocol (OSCP) and Certificate Revocation List (CRL) to “Off”.
      picture 3 List/Guideline for creating Ad Hoc/Distribution Build for iPhone

      picture 4 List/Guideline for creating Ad Hoc/Distribution Build for iPhone

    • Choose Keychain Access -> Certificate Assistant -> Request a Certificate from a Certificate Authority.
    • picture 5 List/Guideline for creating Ad Hoc/Distribution Build for iPhone

    • In the below screen fill the information which you proviede while applying for iPhone developer program. So everything should be the same like you enter’s already.
      So, In the User Email Address field, enter your email address. In the Common Name field enter your name. Empty CA (Certificate Authority) Email Address. Select the ‘Saved to Disk’ radio button and select ‘Let me specify key pair information’ and before clicking ‘Continue’ make sure that the all the fields entered matches the information that was submitted when you registered as an iPhone Developer.picture 6 List/Guideline for creating Ad Hoc/Distribution Build for iPhone
    • Once you clicked on “Continue”, a prompt will be shown. Specify a file name and click ‘Save’. In the following screen select ‘2048 bits’ for the Key Size and ‘RSA’ for the Algorithm. Click ‘Continue’.picture 7 List/Guideline for creating Ad Hoc/Distribution Build for iPhonepicture 8 List/Guideline for creating Ad Hoc/Distribution Build for iPhone
    • The Certificate Assistant will create a CSR file on your desktop.
    • After creating a CSR, log in to the iPhone Developer Program Portal and navigate to ‘Certificates’ > ‘Development’ and click ‘Add Certificate’.
    • Click the ‘Choose file’ button, select your CSR (from desktop) and click ‘Submit’. If the Key Size was not set to 2048 bits during the CSR creation process, the Portal will reject the CSR.
    • Upon submission the certificate, you have to clicked on Approve as well, if you are the Admin.
    • Once your CSR is approved by Admin then download that in to your mac machine. On your local machine, double-click the downloaded .cer file to launch Keychain Access and install your certificate. You will see the certificate with your Name there (either distribution or developer).

      Note: After Certificate is created you will never have to do the this step again for any application. This is only one time process.

  2. Creating an App Id is very easy and you dont have to do this step again while the process of developing any other application, you have to follow few simple steps:
    • Log in to the iPhone Developer Program Portal and navigate to ‘App IDs’ and click ‘Add Id’.
    • In “App Id Name” enter any name, in my case I will enter wildcard and in “App Id” enter something like * and clicked on Submit.
      picture 9 List/Guideline for creating Ad Hoc/Distribution Build for iPhone
  3. Now the second last step is to add devices on your Developer Portal.
    • Log in to the iPhone Developer Program Portal and navigate to ‘Devices’ and click ‘Add Device’.
    • In “Device Name” insert your Name/Client iPhone name(i.e AdeemApp) and in “Device ID (40 hex characters)” enter the 40 hex char words( these words can easily be found using iTunes. If you dont know then kindly mail me, I will guide you through). After that click on “Submit”picture 11 List/Guideline for creating Ad Hoc/Distribution Build for iPhone
  4. Now the last step is to create a Provisioning File for your iPhone or client’s iPhone and this will be your last step for creating binary which you can install on your iPhone or client’s.
    • In to the iPhone Developer Program Portal and navigate to ‘Provisioning’ > ‘Distribution’ and click ‘Add Profile’.
    • Now select “Ad Hoc” in “Distribution Method”
    • In “Profile Name” type your application name (i.e iphoneapp). This name will be your provisioning profile name.
    • In “App ID” select the app name (i.e wildcard) which you created in Step 2
    • Mark checked to all the Device ID’s you created in (Step 3) or you will need for distritbution.
    • Click Submit and after that refresh your page 1 or 2 times until you see the download button.
    • Download the Provisioning profile and copy it to your /YourUserName/Library/MobileDevice/Provisioning Profile folder.
  5. Now everything is step up on Developer portal, open your project in Xcode

    • Select your project from “Group & File” in left side bar. Right click on it and select “Get Info”( or click on “i” ( info ) button).

      picture 12 List/Guideline for creating Ad Hoc/Distribution Build for iPhone

    • Move to “Configuration” tab and select “Release”. Press the “Duplicate” button from bottom, name is “i-Debug”.

      picture 13 List/Guideline for creating Ad Hoc/Distribution Build for iPhone

    • Click on “Build” tab and select “i-debug” and type in “Search in Build Settings” filed ‘Base SDK’ and select the current selected Device and change it to what device your application is targetting ( I prefer “Device – iPhone OS 2.0)

      picture 14 List/Guideline for creating Ad Hoc/Distribution Build for iPhone

    • Now in “Search in build setting” field type “code signing identity” and select the provisioning profile you created in Step 3. Also do the same thing for the child property “Any iPhone OS Device”.
      picture 14 List/Guideline for creating Ad Hoc/Distribution Build for iPhone
    • Select your project from “Group & File” in left side bar. Right click on it and select “Add”> “New File”
      picture 16 List/Guideline for creating Ad Hoc/Distribution Build for iPhone
    • Select “Code Signing” under “iPhone OS” and select “Entitlements” and clicked Next. Name it Entitlements.plist and press Finished
      picture 17 List/Guideline for creating Ad Hoc/Distribution Build for iPhonepicture 181 List/Guideline for creating Ad Hoc/Distribution Build for iPhone
    • Select Entitlements.plist and unchecked the “Value” checkboxed
      picture 19 List/Guideline for creating Ad Hoc/Distribution Build for iPhone
    • Now Close the Info screen and select the “Target” > “YourApp” from “Group & File” in left side bar and clicked on “Info” button again from Xcode.

      picture 15 List/Guideline for creating Ad Hoc/Distribution Build for iPhone

    • Now looked for “Code Signing Entitlements” and double clicked on the empty place. It will come up with an prompt. Enter “Entitlements.plist” and press ok

      picture 20 List/Guideline for creating Ad Hoc/Distribution Build for iPhone

      picture 21 List/Guideline for creating Ad Hoc/Distribution Build for iPhone

    • Now in “Search in build setting” field type “code signing identity” and select the provisioning profile you created in Step 4. Also do the same thing for the child property “Any iPhone OS Device”.

      picture 22 List/Guideline for creating Ad Hoc/Distribution Build for iPhone

    • Now Info screen is still open clicked on “Properties” tab and in Identifier field type the “<full_reverse_dns_company_and_application_or_suite_name>”
    • Everything is set up, click on “Build”(cmd+B) from Xcode>Build
    • Now right click on “Product”>”YourApp” and select “Reveal in Finder”. This is your binary file so please zip this file.

Send this Zip file to your clients along with the provisioning file you created( in step 4). Asked them to drag that proviosiong file in to iTunese > Library> Applications and then drag that zip file in the same place. It will successfully be placed in iTunese Application. Installed it to your iPhone then using sync.

I hope this will help many peoples icon smile List/Guideline for creating Ad Hoc/Distribution Build for iPhone

You can also check an other post regarding Submitting your application to Apple Store.

Popularity: 13% [?]

My name is Adeem M Basraa. I am a software engineer from Lahore, PK. I’ve been involved in software development for nearly 4 years, with the last 1 year focused on application development for mobile devices (iPhone & Android).

13 Comments on "List/Guideline for creating Ad Hoc/Distribution Build for iPhone"

  1. Agha says:

    Best artical yet so far I have seen

  2. Ken says:

    I go through the entire process to get this error: “Your mobile device has encountered and unexpected error” (OxE800003A) “Application Verification Failed”

    Any suggestions?

    Ken Loyst

  3. admin says:

    @ken,
    Check this link for details, if it does not please let me know. http://www.drobnik.com/touch/2009/05/how-to-fix-code-signing-errors/

  4. RZ500 says:

    I did all you said, but when I muve my files tos the aplication folder from my ITunes it wont get installed, I move the zip file and the provisione one, and if instead of the zip I install the unzip one trough ITunes like a normal app it wont open on my IPhone, any idea of my problem?

    Kind regards

  5. Hephistocles says:

    First of all, thank you for this superb guide.
    In step 5, you say “select the provisioning profile you created in Step 3.” Is this an error? I don’t think a provisioning profile was created in step 3, only in step 4.

    My problem is that I have downloaded two provisioning profiles, one for development, and one for ad hoc, and while I have no problems with the development profile, when I try to select the ad hoc distribution profile in the project info in step 5, the distribution profile is greyed out, and it says something like “.” The developer profile is bold and works fine.
    Any ideas as to what I should do?

  6. Roger says:

    Thanks – this was very helpful! I got my Ad Hoc dist working first time.

  7. Marc says:

    great post + screenshots!

    I wrote a simple reusable script for automating this whole process:
    http://iphonedev.makerlab.org/2009/12/packaging-script-for-iphone-ad-hoc-distribution-builds/

    including creating a .ipa archive for iTunes installation with iTunesArtwork 512×512 file

  8. Musafa says:

    That was very helpful, thanks.

  9. Thanks for writing this, figures Apple would make it a pain in the ass.

  10. Jepson says:

    I love this. I am still stuck so a few more screens should do it.
    It has been helpful in learning where I’ve stucked.

  11. Hi i am so pleased I found your blog, I really found you by mistake, while I was searching Yahoo for something else, At Any Rate I am here now and would just like to say thank you for a wonderful blog posting and a all round intriguing blog (I also love the theme/design), I do not have time to read it all at the right now but I have bookmarked it and also added your RSS feeds.

Trackbacks for this post

  1. Noticias - Sistec Solutions - Ultimos Enlaces
  2. pligg.com

Got something to say? Go for it!