Thursday, June 4, 2009

iPhone SDK development on multiple computers

Sometimes it's good to be able to use several computers to develop your iPhone app. In my case my main development machine is the iMac, but summer is coming up and I may not want to stop developing just because I go out of town. Luckily I have a MacBook, on which I have also installed the iPhone SDK.

In order to test on the device when I develop using the MacBook I have to move my certificate, private key and provisioning profile to it. Here's how I do that.

1. Launch Keychain Access on the iMac (main development computer).

2. Under the Keys category I Ctrl-click the private key that has the certificate for 'iPhone Developer: ' attached to it.

3. In the context menu select 'Export ...'.

4. When saving provide a password, which will be required for importing on the other computer.

5. A .p12 file was saved, transfer it to the target computer.

6. Grab the development provisioning profile (either by downloading from the iPhone Program Portal or by grabbing the right one from ~/Library/MobileDevice/Provisioning Profiles/) and transfer it to the target computer.

7. Double click the .p12 file on the target computer. If you provide the correct password the key and certificate will be installed into the Keychain on the target computer.

8. Drag the provisioning profile onto the Xcode dock icon.

The application can now be installed on the device from the target computer, which in my case is the lovely black MacBook.

14 comments:

Daniele said...

thanks for the post. clear and to the point!

joe said...

followed your instructions and in 2 minutes I was up and running (this is probably obvious, but I need to "clean all" to have the code re-signed before app would run on device)
Thanks.

Dalamar said...

After a lot of working repeating all the steps and verifying possible problems, it just worked with the following:
-make login keychain the default one
-make sure you have imported the data in the login keychain, not in the system one.

graphicaliber said...

thanks a ton! I was installing the provisioning file first, which wasn't updating after I installed the certificate.

JES said...

Do the two accounts have to have the same name? I'm trying to get my wife set up on her computer to use my keys and profile, but it doesn't like it.

The Evil Boss said...

JES: My accounts are named the same on both computers, so I haven't tried. But I don't see why it shouldn't work with differing accounts.
Maybe you can try adding your account to the computer to see if that makes a difference?

Somnath Banerjee said...

Thanks!!!
This was very helpful.

kshitiz said...

awesom
you made me running within a minute
absolutely gr8

Ben said...

I cannot export the cert as a .p12 file, only as a .cer

The Evil Boss said...

Ben: You shouldn't export the certificate, instead you export the private key which the certificate is attached under. You do this from the Keys category.

There should be a file format selector in the Save As-sheet which appears after you click Export in the private key's context menu.

Make sure to follow the steps exactly as described. Good luck.

Simon Levy said...

Thanks -- this was the solution that worked for me after hours of failed attempts!

Lokesh said...

Its an awesome laternative and the smartest one as well... Thnx a ton...saved me another 12 hours of searching for the right solution to my problem

cabhara said...

Thanks so much. Finally I can use my MBA for deploying.

Vincent Garguilo said...

Brilliant and simple. Your would think Apple would have made this process better by now. The original post was made in 2009, it is not 2013 and this stupid process still exists.