Code signing proves to Apple, Google and users that an app comes from you and has not been altered. On iOS it requires a distribution certificate and a provisioning profile tied to your bundle ID; on Android you sign uploads with an upload key while Google holds the app signing key. With AI coding agents, the key rule is that agents may write signing configuration but must never hold private keys, passwords or API keys.
On this page
Signing is the step where agent-built apps most often stall right before release. The code compiles, the tests pass, and then the archive fails because of a missing profile, an expired certificate or a keystore nobody can find. There is also a security dimension that is new with coding agents: the signing identity is the most valuable secret in a mobile project, and an agent with broad file and shell access must be kept away from it. This guide explains the moving parts on both platforms and a setup that works for teams using Claude Code, Codex or similar agents.
iOS: certificates, identifiers and profiles
Apple's system has three pieces. A certificate binds a private key, stored in your keychain, to your developer team. For store releases you need an Apple Distribution certificate; for running on devices during development, an Apple Development certificate. An App ID registers your bundle identifier and the capabilities the app uses, such as push notifications or Sign in with Apple. A provisioning profile combines the certificate, the App ID and, for development, a list of devices, and is embedded into the app.
Xcode's automatic signing creates and renews these for you when you are logged in with a team account. That is the simplest route for a single developer on one Mac. For CI and for teams, a common choice is Fastlane match, which stores encrypted certificates and profiles in a private repository or cloud storage and installs them on each build machine. Xcode Cloud manages signing on Apple's side. Whatever you choose, capabilities matter: if the agent adds push notifications in code but the App ID does not have the capability, the archive or the feature will fail.
Android: upload key and app signing key
For new apps on Google Play, Play App Signing is mandatory. Google generates or receives and stores the app signing key that signs the APKs delivered to users. You keep an upload key in a keystore file and use it to sign the bundles you upload. If you lose the upload key, Google support can register a new one after verification. That makes Android more forgiving than the old model, where losing the signing key meant you could never update the app again. It does not make the upload key less sensitive: anyone with it and access to your Play Console publishing flow could ship a build in your name.
| Item | Platform | Who should hold it | Can the agent touch it? |
|---|---|---|---|
| Distribution certificate private key | iOS | Keychain of a trusted Mac or encrypted CI storage | No |
| Provisioning profile | iOS | Generated by Xcode, match or Xcode Cloud | May reference it, should not create it |
| App Store Connect API key (.p8) | iOS | CI secret store | No |
| Signing settings in the project | Both | Repository | Yes, with review |
| Upload keystore and passwords | Android | CI secret store, offline backup | No |
| App signing key | Android | Google, through Play App Signing | No |
A safe setup for agent-driven teams
- Separate environments. The agent works in a development environment that has no access to production signing material. Release signing happens only in a CI job or on one designated machine.
- Secrets by reference. Gradle reads keystore passwords from environment variables; Fastlane reads the match passphrase and API key from CI secrets. The repository contains names of variables, never values.
- Ignore rules first. Add
*.jks,*.keystore,*.p12,*.p8,*.mobileprovisionand local property files to.gitignorebefore the agent starts work, and run a secret scanner on every push. - Agent permissions. Configure your agent to deny reads of keychains and secret folders. Claude Code supports permission rules in settings; Codex cloud environments let you control which secrets exist in a task.
- Documented ownership. Write down who owns the Apple team, who can create certificates, where the upload keystore backup lives and when certificates expire.
These practices belong to the wider topic of secure agentic coding guardrails that every team using agents should adopt.
Troubleshooting the usual signing errors
Most signing failures have a handful of causes. No profile matching the bundle ID: the agent changed the bundle identifier or a target was added without registration. Missing entitlement: a capability was added in code but not on the App ID. Certificate not found: CI runs on a fresh machine without the certificate installed. Android upload rejected for wrong key: the bundle was signed with a debug or a newly generated key instead of the registered upload key. When asking an agent to diagnose these, give it the error output, not your keys; it can explain the cause and fix the configuration, and a person then performs the account-side action.
When to bring in help
Signing is learnable, but it is unforgiving under time pressure before a launch. AppSubmitter.io helps with the account side of publishing, including team setup, certificates and the store submission itself, until the app is live. If you want your engineers to own automated, secure release pipelines, the neoOutput workshops teach agent workflows with these guardrails built in. For the next step after a signed build, read TestFlight beta testing for AI-built apps.
Frequently asked questions
How long is an Apple Distribution certificate valid?
Apple distribution certificates are currently valid for one year. Apps already on the App Store keep working when the certificate expires, but you need a valid one to upload new builds.
What if I lose my Android upload key?
With Play App Signing, you can request an upload key reset in the Play Console and register a new one. The app signing key held by Google is not affected.
Is it safe to paste a signing error into an AI agent?
Yes, error messages are fine. Never paste private keys, passwords, keystore files or API keys into an agent conversation or the repository.