Saturday, July 18, 2009

Deploying iPhone Apps on Multiple Devices

I assume you already know how to run your developed iPhone app (either in debug or release mode) on a device (iphone or ipod touch). Suppose you got a new device and want to run the app on the new device -- now what? Well, you go through the steps involved in getting a new provisioning profile and think everything should work OK. But I have gotten error messages that reads as below and have spent a lot of time trying to figure out what was wrong. The error message shows when I didn't install the provisioning profile properly and try to run the app on the device:
Error: Can’t run ‘XYZ’ on the device ‘Developer iPhone’ The device doesn’t have provisioning profile the application was signed with. Add the provisioning profile to this advice via the Organizer, or check the ‘Code Signing Identity’ build setting.

A simple google search revealed that several people have faced the same problem. But the solution was never well documented so I am providing detailed steps on what to do when you get a new device to use in your development. (or what to do when you get the same error message)


Steps to follow when you want to deploy app onto a new device:

1. Open xcode -> organizer, copy the device identifier

2. Log into iPhone developer program portal
Go to devices and add device

3. Go to provisioning
Edit the provisioning profile
Select new device under devices and submit to get a new provisioning profile

4. Download the new provisioning profile

5. Double-click the downloaded provisioning profile to install it on local machine
Most people miss this step.

6. Drag provisioning profile to organizer window for corresponding device

7. Now in xcode, highlight the top-most item (project name) and click on info button.
In the Build tab -> Code signing identity -> select the new provisioning profile


8. Now clean project by going Build -> Clean all targets
(optional step is to select Xcode -> Empty Caches)

9. Once you have verified everything is working fine, go to
~/Library/MobileDevice/Provisioning and delete the old provisioning profile. A provisioning profile filename ends with .mobileprovision.



-도시

1 comment:

  1. I, too, missed step 5... This solved my problem. THANKS!

    ReplyDelete