Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode: How to export a developer profile in order to import it on another Mac

Tags:

xcode

I need to export my developer profile from my old Mac and import it on another Mac because I'm getting the following error:

Your account already has a valid iOS Development certificate

I found out that I can export it from here:enter image description here

But on my mac I have 2 accounts there, if I click export accounts do I export both of them? Because I just need one account. Is there any other solution? Like exporting the private key used to sign the iOS Development certificate and import it on the new Mac?

like image 501
LS_ Avatar asked Dec 03 '15 10:12

LS_


2 Answers

I'd recommend not using Xcode's export option, but instead to go into your Keychain Access.app, and copy the key/cert manually.

To do so, in Keychain Access, create a new keychain (by default it will be stored in ~/Library/Keychains). Select your login keychain, and then My Certificates under Category. You should now see your certificate in the right panel. It should have a disclosure arrow on the left side, and toggling that should show you your private key. Select the certificate, and copy/paste it into your new keychain (don't drag it, or it will remove it from your login keychain).

Now you can copy that keychain to your new computer, open it in Keychain Access.app and copy the key/cert to your login keychain there.

And the reason I don't recommend using Xcode for this, is exactly what you mention, that it exports all accounts. I've had clients in the past send me 'their developer key/cert' exported in this manner, that included the key/cert for dozens of other developers in their company.

like image 50
Dave Wood Avatar answered Oct 13 '22 02:10

Dave Wood


The way I solved it was to:

  1. export all accounts as your personal backup (good to have in a secure place anyway, in case you lose your machine)
  2. delete all developer accounts in Xcode Accounts manager (Xcode - Preferences - Accounts) except for the account you want to share with your team
  3. repeat the same backup/delete_all_but procedure in Xcode Keychain app for "my certificates" (not 100% sure this is necessary, but doesn't hurt)
  4. export the remaining developer account(s) from Xcode Accounts manager and share it with your team
  5. import your backup to have everything on your machine again (and delete duplicates if necessary). You might have to log in to your Apple ID again from the Xcode Accounts manager
like image 36
metakermit Avatar answered Oct 13 '22 02:10

metakermit