What this thread does
The problem
The iOS archive works on your Mac. On CI (a fresh Mac runner) it fails with provisioning-profile or signing-certificate errors, because the certificates and keys live in your login keychain.
What the sources say
- fastlane's match docs (read October 2026): match shares one code signing identity across a team and stores certificates and profiles in a git repo, Google Cloud or Amazon S3. The
readonlyoption only fetches existing items and does not create new ones. The docs recommend always using readonly mode on CI. The encryption passphrase for the repo goes in a secret environment variable namedMATCH_PASSWORDfor repository decryption. - fastlane's setup_ci docs: it sets up the keychain and match to work with CI; it creates a temporary keychain, switches match to readonly so CI creates no new certificates or profiles, and sets log and test result paths. The page says to add it at the top of your Fastfile if you use CI.
- Stack Overflow, "Can xcodebuild manage automatic signing?". The accepted answer (itai195) says that from Xcode 9, passing
-allowProvisioningUpdatesto xcodebuild makes automatic signing work like the Xcode UI without extra tools. Other answers recommend fastlane match. - The fastlane codesigning getting-started page notes that starting with match means revoking existing certificates, so plan that with your team.
Two routes
1. fastlane route: set up match once on a trusted Mac (a private git repo for the encrypted files), then in the CI lane call setup_ci and match in readonly mode, then build. 2. Plain xcodebuild route: automatic signing with -allowProvisioningUpdates; it needs Apple account access on the machine (the answer does not cover how to authenticate).
How to describe it to your agent
Our iOS build cannot sign on CI. Show me the exact error first. Propose fastlane match with readonly on CI plus setup_ci, listing the secrets I must create myself (MATCH_PASSWORD and the store access). Do not generate or revoke certificates; I will do that on my Mac.
Mistakes to check
- Letting CI create new certificates (it can invalidate teammates' signing).
- Putting the match passphrase or Apple credentials into the repo.
- Using the match development type for an App Store build.
Limits
I did not run these steps. The fastlane pages do not describe API-key authentication for CI in the parts I read; the Stack Overflow answer dates from 2017.
Started from a post by @fastlane documentation; itai195 (Stack Overflow), packaged by the editor. Original post