MoProPro: a single command to add testers to iPhone provisioning profiles

Distributing iPhone applications to testers requires the developer to sign their code using a combination of a (ad hoc) distribution certificate and a mobile provisioning profile, which explicitly contains the device ids (UDIDs) of all your testers.

Introducing MoProPro

MoProPro automates as much as possible of a very specific, but for iPhone developers very common and tedious, task: adding tester’s UDIDs to an existing ad hoc distribution provisioning profile and downloading the new version of the profile. While this doesn’t sound that hard, compare ‘Before’ and ‘After’

Both the ‘Before’ and ‘After’ scenario assume you’ve already set up your app, a distribution certificate, a mobile provisioning profile and acquired the UDID ‘1234567890DEADBEEFCOFFEE098766654321ABCD’ that you want to add to your testers…

Before

  1. Go to the iPhone Dev Center website
  2. Click login
  3. Fill in credentials and login
  4. Go to the iPhone Developer Program Portal
  5. Go to the Devices page
  6. Click on Add Devices
  7. Enter and name the UDID, submit
  8. Go to the Provisioning page
  9. Click on Distribution
  10. Find the right (ad hoc) provisioning profile for your app
  11. Click on Edit, click on Modify
  12. Check all boxes of the newly added devices, submit
  13. Wait a bit, refresh the page, until the Download button appears again
  14. Download the new provisioning profile

Most of this process is pretty mechanical and boring. Also, most of this process could be smoother if Apple had made a better web interface, based on common use-cases, which will hopefully happen somewhere in the future. But, in the meantime, and for people that just like the command prompt, witness ‘After’:

After

Using the Terminal, go your project’s directory (containing the Info.plist file, and a .mopropro file containing the ADC credentials for this project) and run:

$ mopropro 1234567890DEADBEEFCOFFEE098766654321ABCD "Name for Device"
Saved new provisioning profile to 'Example_Ad_Hoc.mobileprovision'
$

That’s it.

If you add the -v switch, you can see (more or less) what it does, for example:

Validating input... Ok.
Getting App Id... com.example.app
Logging in... Ok.
Looking up existing devices... Done.
Adding 1 device... Submitted.
Looking up provisioning profile...
 - Found 5 profiles
 - Found 2 matching profiles
 - Found Ad Hoc profile
 - Adding devices
Saving profile with new devices... Ok.
Waiting a bit while the new profile is generated... Ok.
Trying to retrieve new profile... Got it!
Saved new provisioning profile to 'Example_Ad_Hoc.mobileprovision'

The script has some more options and can also accept multiple devices. All ‘documentation’ can be found in the README in MoProPro’s repository on GitHub. Enjoy!

About

MoProPro uses the excellent WWW::Mechanize library to automate using the iPhone Dev Center website. The Plist library is used for getting the application identifier out of the Info.plist file. YAML is used as the format for the configuration and input files.


About this entry