Sharing the iOS Distribution Certificate

December 13th, 2010 2 min read

Apple only allows one member of an enterprise account to hold the Team Agent role, and the distribution certificate is tied to that member. If you want multiple machines to be able to sign builds with that certificate, you need a way to share its private key. Below are the steps I found for sharing that certificate and provisioning a second machine for producing a distributable build.

Exporting the Certificate

  1. Open Keychain Access.
  2. In the Category panel, select Certificates.
  3. Select the certificate you want to export (should be named something like iPhone Distribution: [Original Developer Name]).
  4. Highlight both the certificate and its private key.
  5. Right-click and select Export 2 items.
  6. Select a location to save the .p12 file.
  7. (Optional) Enter a password - this will be used to install it on the other machine.
  8. Press Save.

Importing the Certificate

  1. Double-click the .p12 file (this should cause Keychain Access to open).
  2. If you set a password when exporting, enter it into the Enter Password prompt; otherwise, leave it blank and press OK.
  3. You should now have a new certificate in the login keychain. N.B. This certificate and private key will have the same name as they did on the first machine.
  4. Log into your Team Agent account on http://developer.apple.com/.
  5. Select the iOS Provisioning Portal link.
  6. Select the Certificates->Distribution tab and download the certificate for the Team Agent.
  7. Double-click the downloaded file to install it in the keychain.
  8. Select the Certificates->Development tab and download the WWDR intermediate certificate.
  9. Double-click the downloaded file to install it in the keychain.
  10. Select the Provisioning->Distribution tab and download the provisioning profile. N.B. The downloaded file should be a .mobileprovision file; if it's a .cer file, you are in the Distribution tab of the Certificates section.
  11. Drag onto the Xcode icon to install.

Congratulations, you should now be able to sign builds with the distribution certificate on multiple machines.

Possible Roadblock

When double-clicking on any of the above files, you may see the following message:

"The system root keychain cannot be modified"

To overcome this, you'll need to manually add the files to the appropriate keychain by dragging them into that keychain. The AppleWWDRCA.cer should be dragged into the System keychain and any development/distribution certificates into the login keychain.

What do you think? Let me know by getting in touch on Mastodon or Bluesky.

Keep reading