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.
-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
- Sign in to your Apple developer account and open Certificates, Identifiers & Profiles.
- Under Certificates, look for entries created by API or named after CI machines. Their creation dates usually line up with your CI runs.
- Revoke the ones no machine uses any more. Revoking a development certificate doesn’t affect apps already on the App Store.
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:- Create the certificate once and export it with its private key as a
.p12file. - Store the
.p12(base64) and its password as CI secrets, along with the provisioning profile if you sign manually. - At the start of each run, import the
.p12into a temporary keychain and install the profile. - 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. - Make the job fail with a clear message when the secrets are missing. Without that, it falls back to creating a new certificate again.
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.