how to distribute iPhone test app

Jump to: navigation, search

Create the testing app to distribute

1. In Xcode 4 select iOS Device / your own device. Then Product > Archive

2. Open organizer, you should see an archive of your app in Archives tab..

This is the app you want to distribute.

Add a new testing device (optional)

(NOTE: STEP 6 must be done the first time even if no new device are added)

3. Go to

4. Add an iPhone UID. To know the UID, just plug the iPhone in your Mac/PC. The 40 numbers identifier is displayed either in iTunes, either in Organizer. The tester most likely will have to give you her/his UID as you probably don't have access to her/his iPhone

5. Go back into Organizer > Devices tab > Library > Provisioning Profiles (left pane, at the top). Select Team Provisioning Profile. 'Automatic Device Provasioning' should be checked. Click on Refresh button. The Team Provisioning profile should be updated and in the Devices list you should see the new device lister.

6. Click on export and save the Team Provisioning profile in your dirroot on your web server.

Share the testing app

7. in Archives tab, select your app and click on Share.

8. Select iOS ipa and in Identity, select the The Team Provisioning (most likely the last one). Press Next.

9. Select 'Save for Entreprise Distribution'. Enter the url where you want to distribute the app (for example http://wwwroot/MoodleApp.ipa). As title enter the same name (for example MoodleApp). Finally Save As the same name too (for example MoodleApp) in your dirroot

10. In dirroot, write the following php script (source:

$ipas = glob('*.ipa');
$provisioningProfiles = glob('*.mobileprovision');
$plists = glob('*.plist');
$sr = 'http://jerome.moodle.local/~jerome/'; //YOUR WWWROOT
$provisioningProfile = $sr . $provisioningProfiles[0];
$ipa = $sr . $ipas[0];
$itmsUrl = urlencode( $sr . 'index.php?plist=' . str_replace( '.plist', '', $plists[0] ) );
if ($_GET['plist']) {
$plist = file_get_contents( dirname(__FILE__) 
. preg_replace( '/![A-Za-z0-9-_]/i', '', $_GET['plist']) . '.plist' );
$plist = str_replace('_URL_', $ipa, $plist);
header('content-type: application/xml');
echo $plist;
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
<title>Install iOS App</title>
<style type="text/css">
li {
padding: 1em;
<li><a href="<?php echo $provisioningProfile; ?>">Install Team Provisioning File</a></li>
<li><a href="itms-services://?action=download-manifest&url=<?php echo $itmsUrl; ?>">
Install Application</a></li>

Retrieve the testing app

11. The tester can now access the page to install the app. She/He must click on 'Install provisioning profile' the first time, then she/must directly install te app the next time. For update she must delete her previous version first.