Daniel
Daniel

Reputation: 23359

Developing for iOS on multiple computers, testing on a single device, advice?

I was looking for some advice on provisioning profiles / certificates etc... I use an iMac at work to develop on, and I also sometimes find myself checking out my code from git onto my MacBook Pro at home but I always run into issues when I want to test on my iPhone from another computer.

Obviously my provisioning profiles on the device match the certificate issued to my iMac from work, so from my laptop, I can't test on the device because the provisioning profile doesn't match a certificate. so I get a code sign error.

What can I do to bypass this ?

Thanks in advance.

Upvotes: 46

Views: 24951

Answers (5)

Julian B.
Julian B.

Reputation: 3725

If you're using Xcode 6.x - 8.x, there is a very easy way to do this:

See the section titled Exporting and Importing Certificates and Profiles in the app distribution guide.

To sum it up:

  1. go to Xcode's preferences
  2. click on accounts
  3. click on the gear icon at the bottom left
  4. select 'export accounts' and enter the desired filename and password
  5. open the newly created file on your new machine

Done! this will import the profiles from the previous machine.

Upvotes: 10

David
David

Reputation: 1050

This answer does not seem to apply to Xcode 4.6.3 where the Organizer does not have a "Developer Profile" section.

In Xcode 5 and 6 (which most will be using at the time of posting) there is a different procedure which is discussed here.

Upvotes: 1

swift taylor
swift taylor

Reputation: 620

I have Xcode 4.6.1 and in the organizer there is now a refresh button at the bottom right. Hit that, sign in to your Apple account and it should pull all the relevant profile info.

-Cheers

Upvotes: 3

Moshe
Moshe

Reputation: 58087

Apple provides an easy solution to working on multiple machines.

You can export your developer profile from your work iMac and move it onto your Macbook Pro.

  1. In Xcode 4, bring up the Organizer. Click on "Devices"/

  2. Now, click on "Developer Profiles" in the sidebar.

  3. Then, on the bottom of the screen you will see a button called "Export" and a button called "Import". On the computer with the original certificates click "export" and save the profile. You may be prompted to enter a password.

  4. On the second computer, use "import" to install the certificates.

Exporting a developer profile

You should be able to develop and test seamlessly between the two machines now.

Edit:

According to Topher Fangio in the comments below, you may need to:

open Keychain Access, then find [your] iPhone Developer Certificate on my desktop, and export it. Then import it on your [second machine]. If you see the dropdown and associated private key on one machine, but not the other, then you need to export it apparently.

Hopefully Topher's insight will help anyone who has trouble with using Xcode to do this.

Upvotes: 75

Nathanial Woolls
Nathanial Woolls

Reputation: 5291

You need to keep the original private key file and certificate file you create as the absolute first step in the process on the portal. Then you need to import not just the certificate but the private key file too on your laptop. Once that is done, you should be able to sign with your developer cert and provisioning profile on both laptops.

I've gotten in this situation too. You can start it all over on the provisioning portal if needed with no real negative effects.

Upvotes: 3

Related Questions