What this guide covers
When you finish, you hold a password-protected .p12 and provisioning profiles you can download again, so you can keep signing on a different Mac. You need: Xcode signed in to your developer account, the Account Holder or Admin role, and a storage location you control.
Steps
Remember one thing first: the private key is on this remote Mac
A certificate has two parts: the certificate Apple issues (which you can download again from the developer portal at any time) and the private key generated on your side (which exists only in the keychain of the Mac that generated the request; Apple has no copy). Apple's certificate sharing documentation puts it plainly: with only the certificate and no matching private key, you cannot sign with it.
Create a certificate on a rented machine and the private key is on that machine. After the rental ends the machine is reclaimed and erased, so the export steps below are not optional.
Creation method 1: let Xcode generate it
In Xcode > Settings > Accounts, select the account and team, click Manage Certificates, and use the Add button in the lower-left corner to create an Apple Development or Apple Distribution certificate. Xcode generates the private key for you, submits the request and installs the certificate in the login keychain.
According to Apple's certificates overview, distribution certificates belong to the team, each team is allowed only one of each type of distribution certificate (Developer ID excepted), and only the Account Holder or an Admin can create them. If someone on the team has already created one, ask them for the .p12 rather than creating another.
Creation method 2: generate the request file by hand
Following Apple's certificate signing request documentation: open Keychain Access and choose Keychain Access > Certificate Assistant > Request a Certificate From a Certificate Authority. Fill in the email address and common name, leave the CA email empty, and choose "Saved to disk".
Upload the generated request file on the Certificates page of the developer portal, choose Apple Distribution, then download the certificate file and double-click it to install it in the keychain. It pairs automatically with the private key generated a moment ago.
Create the provisioning profile
With automatic signing, Xcode manages provisioning profiles for you. To do it by hand, follow Apple's App Store provisioning profile documentation: on the Profiles page of the portal click Add, choose the App Store Connect type under Distribution, select the App ID that matches your Bundle ID, select the distribution certificate, name the profile, click Generate, then Download.
A provisioning profile contains no private key. If you lose it you can download it again from the portal at any time, so it needs no special backup.
Export the certificate and private key as a .p12
Following the steps in Apple's documentation: in Xcode > Settings > Accounts, select the account and team and click Manage Certificates. Control-click the certificate you want to export and choose Export Certificate. Choose where to save it, enter a file name and a password that protects the private key, and save.
Use a newly generated strong password, store it in your own password manager, and do not make it the same as the Mac login password.
Take the .p12 off this machine
Upload the .p12 to private storage you control (your own cloud drive, an encrypted area of a private repository, or a password manager attachment). As Apple advises, send the file and its password through different channels. Do not send the .p12 or its password to support, and do not paste them into a ticket or a group chat.
Then do a real verification: on another Mac, double-click the .p12, enter the password, and see whether it lands in the login keychain. If you have no second Mac at hand, at least confirm the file downloads completely and the password is recorded correctly.
Checks before the rental ends
Go through each item: the .p12 is off the machine; the password is recorded; you recognize the purpose of every certificate in the portal's list. Only then sign out of the account in Xcode.
If you use Xcode's cloud-managed certificates, Apple's documentation says Xcode shares them automatically and no manual export is needed. If you are not sure which kind you have, look at the certificate's type description in Manage Certificates.
FAQ
I ended the rental without exporting. Can I still use the certificate?
The private key cannot be recovered. According to Apple, a certificate can be revoked in Xcode or the developer portal and created again. Apps already on the App Store are unaffected, but Apple warns that builds uploaded and not yet submitted for review may be marked invalid if they were signed with the revoked certificate.
Exporting the .p12 asks for a keychain password. Which one?
Exporting a private key requires unlocking the login keychain, so enter the login password of your own account on this Mac. If the keychain prompts behave oddly after you change the Mac password, contact Contact support first; do not empty the keychain yourself.
Do development certificates need a backup too?
Development certificates belong to the individual and can be recreated on a new machine at any time, so there is little need to back them up. The one that matters is the distribution certificate: each team can have only one of each type, and if the private key is lost it has to be revoked and recreated.
Can I put the .p12 in the code repository?
Not in plain form. A sounder way for a team to share signing material is to encrypt it with fastlane match and store it in a private repository; see our fastlane guide.
Related
- How do I sign an iOS app and upload it to the App Store from a remote Mac?
- Can I sign in with my own Apple Developer account on a rented Mac?
- Sign in to Xcode with your Apple ID on a remote Mac: steps and the 2FA code
- Xcode automatic vs manual signing: which to use and how to set up each
- Install fastlane and use match to keep signing certificates in a private repo
Pricing and availability: see the plans page · Help center (中文) · Refund policy (中文) · Telegram Contact support