# Re-sign a build

Re-signing runs on your machine. AppBarn never receives signing keys or passwords.

Android APK/AAB:

```sh
export APPBARN_SIGNING_PASSWORD='...'
export APPBARN_KEY_PASSWORD='...'
appbarn resign <build-uuid> --keystore ./release.jks --alias release
```

iOS with an existing identity:

```sh
appbarn resign <build-uuid> --profile ./profile.mobileprovision --identity 'Apple Distribution: Example'
```

iOS with a local P12:

```sh
export APPBARN_SIGNING_PASSWORD='...'
appbarn resign <build-uuid> --profile ./profile.mobileprovision --p12 ./signing.p12
```

The CLI downloads the source, signs and verifies locally, then uploads a new derived Build in the same App/Environment with source lineage.

::: details AI prompt — Re-sign a build locally (Copilot, Codex, Cursor)

```text
Inspect the selected AppBarn Build, platform and local signing tools. Run appbarn resign with the correct local Android keystore or iOS provisioning profile and identity/P12. Ask me about missing Build or signing choices without requesting secret values. Never upload, commit or print passwords or private keys; use documented environment variables. Verify local signing and that the new Build records source lineage in the same App/Environment, then report non-secret results or errors.
```

:::

## Common failures

Missing signer tools, invalid profile/keystore, verification failure or changed source authority all fail closed. Secrets are not passed in command-line arguments.

## Related

- [Re-signing guide](/guides/resign)
- [Signing troubleshooting](/troubleshooting/signing)
