Home/Glossary/What is an App Store Connect API key, and why do build machines use one?

What is an App Store Connect API key, and why do build machines use one?

Updated · airankrush

Term · App Store Connect API key (.p8 file, Key ID, Issuer ID)

An App Store Connect API key is a credential Apple provides for programs to use. After generating one under Users and Access in App Store Connect you get three things: a private key file that can be downloaded only once (extension .p8), a Key ID, and your team's Issuer ID. Tools use the private key to sign short-lived tokens for calling the API. There are team keys and individual keys: a team key is created by an admin and gets permissions from the role you choose; an individual key inherits the permissions of its user, and some features are unavailable to it. Apple does not keep a copy of the private key, so if it is lost or leaked the only option is to revoke it and generate a new one.

How it relates to renting a remote Mac

When you use a rented Mac as a build machine, an API key is often a better fit than signing in to an Apple Account on the machine:

  • No personal Apple Account signed in on the machine. fastlane, xcodebuild, the Transporter command-line tool and others can all upload with it, and scripts do not stop at a verification code.
  • Permissions can be narrowed. Give the key only the role it needs when you create it; do not grant Admin for convenience.
  • Revoking is done on the web and takes effect immediately. When the rental ends, you change machines, or you suspect someone has seen files on the machine, revoke the key in App Store Connect. You do not need to touch that machine again.

Things to watch:

  • The .p8 can be downloaded only once. Keep the original on your own computer or in a password manager; what you transfer to the remote Mac is only a copy.
  • Do not put the .p8 in a code repository, and do not paste it into tickets or chat messages.
  • Add a line to your end-of-rental checklist: "revoke the API key used only on this machine". Create a separate key for each build machine so that revoking one does not affect anything else.

For the generation steps and permission details see Apple documentation: Creating API keys for App Store Connect API.

FAQ

With an API key, do I still need a signing certificate?

Yes. The API key answers "who is talking to Apple's servers", and the signing certificate answers "who signed this package". Neither replaces the other.

Individual key or team key?

A solo developer is the Account Holder, and normally creates a team key with a role that is just sufficient. According to Apple's documentation, individual keys cannot be used for provisioning-related endpoints, notarytool and some other features, so invited members should check the limitations before using one.

Pricing and availability: see the plans page · Help center (中文) · Refund policy (中文) · Telegram Contact support

Back to home · Glossary