Home/Q&A/Can code signing on a build machine be fully automated with no prompts?

Can code signing on a build machine be fully automated with no prompts?

Updated · airankrush

Direct answer

Yes, but the manual routine has to go. Use an App Store Connect API key instead of signing in with an Apple Account, and use script-managed certificates in a dedicated keychain instead of clicking through Xcode.

Basis

  • The fastlane documentation recommends API key authentication where possible, and the first benefit it lists is that no two-factor authentication is needed (App Store Connect API, checked 2026-11-12). The support table on the same page shows that match, cert, sigh, pilot and deliver all support keys, while produce and pem do not yet.
  • fastlane's setup_ci action creates a temporary keychain for match and switches match to read-only mode, so the pipeline does not create new certificates and provisioning profiles on the build machine. By default it only takes effect when it detects a CI environment, and the documentation gives a force option to make it run regardless (setup_ci).
  • You can also do without fastlane: xcodebuild itself supports automatic signing with an API key. For the parameters, follow Apple's documentation and the output of xcodebuild -help.
  • The difference between an always-on machine and a cloud runner is that certificates can stay in the machine's keychain rather than being imported again on every build.

Information as of .

Boundaries: when the answer is different

Some steps still need a person: accepting new agreements in the developer portal, creating an app record for the first time, enabling certain capabilities for an app, and renewing certificates when they expire. When these come up the pipeline fails and someone has to handle it on the web. Certificates and keys kept on a rented machine are your responsibility to safeguard. We do not proactively access device content, but we do not safeguard them for you either. Remove them from the machine before the rental ends and, where necessary, revoke them in the developer portal. If your project has compliance requirements about where certificates are stored, assess that before deciding.

How to do it

  1. Generate an API key in App Store Connect and store the key file's contents in your CI platform's secret variables.
  2. Prepare the distribution certificate and provisioning profiles with match or by hand, and keep them in a private location you control.
  3. Call setup_ci at the start of the pipeline (with force on a self-hosted runner), then sync certificates in read-only mode.
  4. Build, export and upload, with no Apple Account password appearing anywhere.
  5. Note the certificate expiry date and plan the renewal ahead of time.

Use case

This question belongs to the use case: Rented Mac mini as an always-on build machine for small teams? Count your build minutes first

Other questions in the same use case:

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

Back to home · All Q&A