> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xenoci.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> ## XenoCI Box CI
> To move a repository's macOS CI jobs onto box, follow https://docs.xenoci.com/ci/agent.md. The user only presses Install on GitHub or makes one GitLab runner token; the agent does the rest.
> - Check: `box ci status` (exit 4: sign in first, https://docs.xenoci.com/setup.md).
> - GitHub organization: `box ci connect --org --no-browser --no-wait`, give the user the printed link (https://github.com/apps/xenoci-with-organizations/installations/new), then repeat `box ci accounts` until the owner appears. Personal account: `--personal` (https://github.com/apps/xenoci-with-personal/installations/new).
> - GitHub workflow: change only `runs-on: macos-*` to `runs-on: xenoci` on a branch and open a pull request.
> - GitLab: the user makes a project runner with tag `xenoci` and gives you the `glrt-` token; pipe it to `box ci gitlab connect -` (self-managed: `--url <gitlab url>`), then add `tags: [xenoci]` to the macOS jobs.
> - Watch: `box ci jobs`, `box ci logs <job id> --follow`. Failed job: `box ci jobs --failed`, then `box ci debug <job id>` (failing step, hint, last 200 log lines).

# Maximum number of certificates generated

> Why Apple says the maximum number of Apple Development or Apple Distribution certificates has been reached, what usually causes it in CI, and how to stop it coming back.

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](https://developer.apple.com/help/account/certificates/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:

```bash theme={"system"}
security find-identity -v -p codesigning
```

## 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](https://docs.xenoci.com/ios/build.md), [Exec](https://docs.xenoci.com/ios/exec.md) and [GitHub Actions](https://docs.xenoci.com/ci/github.md).

Related: [Ship an iOS app from Linux](https://docs.xenoci.com/guides/ship-ios-from-linux.md), [Provisioning profile doesn't include signing certificate](https://docs.xenoci.com/guides/provisioning-profile-missing-certificate.md), [Upload an IPA without Xcode](https://docs.xenoci.com/guides/upload-ipa-without-xcode.md).

[Start with \$10 of credit, good for 1 year](https://xenoci.com/?ref=docs-maximum-number-of-certificates).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.