Skip to main content
The error means your team already has as many certificates of that type as Apple allows, so Xcode or your CI could not create a new one. It shows up most often in CI, where every run starts on a clean machine with an empty keychain.

Why it keeps happening in CI

Apple’s certificates overview explains the split:
  • Apple Development certificates belong to individuals, and each machine that creates one adds a new entry named after that computer.
  • Apple Distribution certificates belong to the team, and only one of each distribution type is allowed per team.
When a build uses automatic signing with -allowProvisioningUpdates and there is no certificate with a private key in the runner’s keychain, Xcode asks Apple for a new one. A throwaway runner never keeps that key, so the next run asks again. After enough runs the team reaches the limit and archiving fails.

Fix it now

  1. Sign in to your Apple developer account and open Certificates, Identifiers & Profiles.
  2. Under Certificates, look for entries created by API or named after CI machines. Their creation dates usually line up with your CI runs.
  3. Revoke the ones no machine uses any more. Revoking a development certificate doesn’t affect apps already on the App Store.
Be careful with Apple Distribution. The same overview says that builds signed with a revoked distribution certificate can be marked invalid if they were uploaded but not yet submitted for review. Revoke a distribution certificate only when you’re sure no pending build depends on it.

Stop it coming back

Create one certificate on purpose and give CI that same identity on every run instead of letting each run create its own:
  1. Create the certificate once and export it with its private key as a .p12 file.
  2. Store the .p12 (base64) and its password as CI secrets, along with the provisioning profile if you sign manually.
  3. At the start of each run, import the .p12 into a temporary keychain and install the profile.
  4. Archive with that identity. Leave out -allowProvisioningUpdates, or keep it only with an identity already in the keychain, so the build can’t silently create a new certificate.
  5. Make the job fail with a clear message when the secrets are missing. Without that, it falls back to creating a new certificate again.
To check which identity a runner sees before archiving:

Where box fits

box runs the Xcode build or your own archive script on a Mac and returns the files. It doesn’t create certificates or profiles for you. If you want box jobs to sign with your one identity, store the .p12 and its password with box secrets set (sealed on your computer before upload, never readable by box). box build --device-build makes an unsigned Release build that you sign with your own identity. If you use GitHub Actions with runs-on: xenoci, signing works the same way as on any other macOS runner: your workflow imports your one identity from your secrets. See Build, Exec and GitHub Actions. Related: Ship an iOS app from Linux, Provisioning profile doesn’t include signing certificate, Upload an IPA without Xcode. Start with $10 of credit, good for 1 year.