Performing an Ad-Hoc Distribution Build with Unity iPhone

To make an Ad Hoc distribution build to send out to your beta testers, you first have to create the Mobile Provision Profile on the Program Portal.  Once you’ve created this profile, downloaded and installed it according to Apple’s directions, your ready to begin.

Launch Unity iPhone and open the project you wish to build.  Make sure that under Edit->Project Settings->Player the iPhone Bundle Identifier matches the App ID identifier in your profile (if your profile is something like SAD723.*, you may enter any “com.yourdomain.AppName” combination).  Now, set your stripping level and Script Call Optimizations as necessary.

Goto File->Build Settings, setup your build as you normally would for Desktop or Web distribution.  Select ‘Compress Textures’ and ‘Strip Debug Symbols’ (these are really not needed on the device, and only useful if you know what your doing).  Select the ‘Build’ option, not the ‘Build & Run’ option.

Once your XCode Project is available to select in Finder, replace the Icon.png with the icon you wish to use for your application.  The icon must be a 57×57 PNG image.  Optionally, you can select the appropriate Default.png by changing the name of one of the predefined splash images (required for iPhone Basic) or, alternatively using your own (iPhone Advaced required for custom splash).

Once you have done this, go ahead and open the XCode Project.  Under Project->Edit Project Settings, select the appropriate “iPhone Distribution: Company Name” code signing certificate under “Coding Signing Identity”.  Double click in the “Code Signing Entitlements” just above that and enter the value “Entitlements.plist”.

Now, close the project settings and right click on the project in the left pane.  Select Add->New File.  Under “Code Signing” select “Entitlements”.  Name the file “Entitlements.plist” (the same as you entered above).  Once the file is created, open the file with the Property List Editor and uncheck the “get-tasks-allow” option.

Now make sure that the drop-down on the top-left of the project window says “Device – 2.1 | Release”.

You are now ready to build, so let’s do that now by selecting Build->Build.  Do -not- “Build and Go”.

Once your project is built, drill-down into the Products folder of your XCode Project and right click on the “.app” file that is there.  It should be named the same as the last part of your Bundle Identifier (“com.yourcompany.YourAppName” – ie; “YourAppName”).  Right click this file and say “Reveal in Finder”.  Drag the “.app” file onto your desktop, and copy over the “.mobileprovision” file you downloaded to create this build.  Select both, and right click and tell Finder to compress them.

You may now distribute this archive to your beta testers for review.

7 comments for “Performing an Ad-Hoc Distribution Build with Unity iPhone

  1. July 24, 2009 at 7:10 pm

    This is my 8th time referring back to hear to work through this process so I wanted to come by and say thank you for putting this up!

  2. Rob Rhyne
    July 31, 2011 at 3:09 pm

    s/b get-task-allow, not get-tasks-allow

Leave a Reply