Developer-To-Developer iPhone App Distribution Without Ad-Hoc Provisioning

On January 20, 2010

Developers can share iPhone applications that they’ve created with other iPhone developers without using ad hoc provisioning. Setting this up takes less than 5 minutes.

This is one of the method’s I’m considering for distributing CodePromo, my app that makes it easy to generate and share promo codes from the iPhone.

This article provides step-by-step instructions; it’s an expansion of the summary of the technique by Erica Sadun.


When you build and run on your development device Xcode first creates a device-compatible binary. and then signs it using your developer certificate. This latter step is what allows your device and its development provisioning profile to run the application. Apple provides tools that allow a binary’s signature to be replaced; if you’ve got a development certificate and a binary you can re-sign an app; it’s this re-signing that’s at the heart of this technique.

Preparing For Distribution

Step 1. Compile A Device-Compatible Binary

You create a device-compatible binary when you build to your device in Xcode. Open any iPhone project in Xcode and:

  1. In the Overview menu, choose iPhone Device for the Active SDK.
  2. While still in the Overview menu, choose Release for the Active Configuration. This will produce the smallest sized binary.
  3. Build the project using Build > Build from Xcode’s menu or by using the command-b keyboard shortcut.

Proceed to the next step after everything builds cleanly.

Step 2. Locate The Binary

Locate the compiled binary:

  1. Locate the Products folder under the project’s folder in the Groups & Files panel in Xcode. Expand it to show its contents.
  2. Locate the .app file for the app, right-click or command-click its icon, and click Reveal in Finder.

This’ll reveal the binary in the Finder.

Step 3. Create A Re-Signing Script

The binary you’ve created will only run on devices that have your development provisioning profile installed on them. For other developers to run your app they’ll have to re-sign the app using their provisioning profile. We’ll include a shell script to make it easier for them:

  1. Create a shell-script using the text editor of your choice.
  2. Paste the contents below into the editor.
  3. Replace the _APP_NAME_ in the shell script with the name of your app.
  4. Name it and save it somewhere convenient.

export CODESIGN_ALLOCATE=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate
codesign -f -s "iPhone Developer"

Step 3. Bundle Items For Distribution Folder

We’ll distribute a zip containing the binary and helper script from the previous steps:

  1. Open a new Finder window, navigate wherever you want the folder to reside and create a new folder. Use the app’s name as it will appear on the springboard as the name of the folder.
  2. Copy the app’s binary and the helper script from the previous steps into the new folder.
  3. Zip the folder.

And you’re ready to distribute the app.

The next section of this article shows the steps the recipient uses to install the app onto their developer provisioned iPhone.

Installing The App

It’s straightforward to install an application prepared as above:

Step 1. Extract and Re-Sign The App

  1. Extract the contents of the zip to a convenient location.
  2. Open a terminal window and navigate to the folder containing the zip’s contents.
  3. Type from the command prompt to run the helper script to re-sign the binary. The script will output replaced existing signature if successful.

Step 2. Install The App

  1. Connect your phone to your computer and open Xcode.
  2. Use Xcode’s Window > Organizer, or the keyboard shortcut command-o, to open the Organizer.
  3. Select the phone from the DEVICES section in the left panel.
  4. Click the “+” beneath the Applications list/section of the Summary tab in the right panel, locate the .app file in from the zip, and click Open.

And that should do it. The app should now installed on the phone.


I created a rough ~2 minute screencast demonstrating both sides of this process. View it here, or in higher-res at Vimeo.

Workshop: iPhone Development For Web Programmers. Minneapolis/MN, Feb 10-11. $1300 $899 when you register by Feb/1 with the “mo” coupon code.

0 responses to “Developer-To-Developer iPhone App Distribution Without Ad-Hoc Provisioning”

  1. lottadot says:

    I took what you did and automated it via a build script. It’s on github: