Symptom: fastlane match reports a sync, certificate, or signing error on your remote Mac.
Fastest fix: use the original log to identify whether the failure is Git access, decryption, Keychain installation, profile selection, or the later Xcode build. Repair that stage; do not revoke or recreate every certificate as a first response.
This week, save the complete failing command and log, then rerun the relevant check as the same user and task that builds the app.
This runbook is for you if you are setting up fastlane match on a remote Mac for the first time, moving an iOS build from a local Mac, or maintaining a persistent build host. It is also for small teams trying to avoid duplicate signing assets or an unnecessary certificate revocation.
Diagnose a fastlane match certificate sync failure by stage
Treat the first meaningful error as the lead. A later xcodebuild signing error may be a consequence of an earlier failure, not evidence that the profile itself is wrong. Keep the full log, the exact command, and the task context before changing anything.
Read the log in execution order:
- Repository access: the process cannot reach or clone the configured storage repository. Start with the Git URL, network access, SSH identity, and repository permissions.
- Decryption: the repository is reachable, but encrypted signing material cannot be decrypted. Check whether the running process has access to the correct match password.
- Installation: match retrieves and processes the assets, but the expected signing identity or private key is missing from the Keychain available to the build.
- Profile or build signing: the profile is absent, invalid for the target, or not selected by the build. Inspect the target configuration before regenerating assets.
fastlane match stores signing files in a Git repository by default and encrypts them with a passphrase. Its storage and password options are documented in the match action reference. This gives you a useful diagnostic split: if the repository cannot be cloned, investigate access; if it can be cloned but the encrypted files cannot be opened, investigate decryption.
Do not discard the first error in favor of the last error in a long build log. Preserve enough context to reproduce it, but redact secrets, tokens, private keys, and sensitive repository details before sharing logs. MangoVM’s data protection information is relevant when deciding how to handle sensitive material in a remote environment.
Separate repository access from decryption
A remote Mac can behave differently from your laptop because the command may run under another user or without the SSH identity you use interactively. Check the effective Git URL and authentication method used by the actual task. A successful clone from your desktop does not establish that an SSH job or CI process can access the same repository.
Use this order:
- Confirm that the configured storage URL points to the intended repository and that the remote task can reach it.
- Check which SSH identity or other approved Git credential mechanism the task uses.
- Verify that the repository permission applies to that identity, not only to your personal interactive session.
- If cloning succeeds, check that the task can read the match password from the approved secret store or environment.
- Retry the same match operation without changing the shared certificate repository.
Keep secrets out of shell history, source control, screenshots, and CI output. Do not add a password directly to a command that may be logged. Fastlane documents the encryption and storage behavior in its match configuration documentation; use that as the reference for the settings in your project rather than guessing from a command copied from another machine.
A useful distinction: authentication errors generally point to repository access, while a decryption error after successful retrieval points to the encryption secret or encrypted content. Avoid “fixing” either case by creating another certificate. That can leave the team with multiple valid-looking assets while the original access problem remains.
Verify the certificate and private key in the build Keychain
A downloaded certificate file, an installed signing identity, and an accessible private key are different states. The build needs the identity and its associated private key in a Keychain context available to the process that signs the app. Apple explains that signing identities pair certificates with private keys in its certificate-sharing documentation.
Check the environment that actually performs the build, not just a Remote Desktop window:
- Run the identity inspection from the same macOS user used by the build task.
- Compare the reported signing identities with the certificate expected by the app.
- Confirm that the private key is present and accessible to that task.
- Check whether the job uses a different Keychain or login context from your interactive session.
- Repeat the check from the same SSH command or automation runner that invokes fastlane.
For a local diagnostic, fastlane’s code-signing troubleshooting guide includes Keychain and signing-identity checks, including the security find-identity -v -p codesigning command. Run it in the task context under investigation. If the identity appears in one session but not another, the difference is a strong clue: fix the task’s Keychain setup or execution user before modifying the certificate repository.
Do not export or regenerate a private key just because a build task cannot see it. First establish which user and Keychain the task is using; otherwise you may create a second signing identity without resolving the visibility problem.
Match the profile to the failing target
A valid certificate does not make every Provisioning Profile valid for every app target. Compare the profile’s App ID, profile type, included signing certificate, and the target’s Bundle ID. Then confirm which profile the build settings select.
Check these items for the specific failing target:
- Bundle ID: it must correspond to the App ID covered by the profile.
- Target: extensions and other targets can use different Bundle IDs and profiles from the main app.
- Signing type: make sure the profile is appropriate for the build you are producing.
- Certificate: confirm that the profile contains the signing certificate the build is using.
- Selection: inspect the target’s signing settings and the profile actually chosen during the build.
Apple’s Provisioning Profile management guidance explains how profiles can be edited, downloaded, or deleted. For an App Store profile, use Apple’s profile creation instructions to verify the intended profile setup.
Do not force a refresh simply because the error mentions a profile. First inspect its contents and the target’s effective settings. If the profile is correct but the project selects another one, fix the target mapping. If its App ID, type, or certificate cannot satisfy the target, then update or regenerate the profile deliberately.
This is a common migration trap: the main app signs successfully, so the maintainer assumes the extensions are covered too. Check each target independently. A notification extension or share extension can fail while the main app’s profile remains valid.
Check Xcode selection and multi-target mapping
A remote task may invoke a different Xcode installation from the one you selected in an interactive session. Record the Xcode version and active command-line tool path from the same task that runs fastlane. Compare those values with the project and build configuration you expect. Apple’s Xcode command-line tool reference documents the command-line build tools; use the actual job output to confirm what your environment selected.
Then inspect target mappings rather than assuming one successful target validates the whole project. For every app, extension, or other signed target, compare its Bundle ID, signing style, profile assignment, and expected certificate. If the project uses automatic signing for one target and explicit profile selection for another, investigate each configuration separately.
A focused check is more useful than a broad reset:
- If match fails before it retrieves assets, stay on repository access or decryption.
- If match retrieves assets but the identity is absent, investigate Keychain visibility and the private key.
- If the identity is available but one target fails, compare that target’s profile and signing settings.
- If behavior changes with the task’s Xcode selection, align the command-line tool path and the build job before regenerating profiles.
Fastlane’s common code-signing issues also describe configuration mismatches that can surface during signing. Use the error and target-specific settings together; a generic signing message alone does not establish which asset is wrong.
Choose the smallest repair, then validate the archive
Use this decision path before making a change:
- If the repository cannot be cloned, repair the URL, SSH identity, network route, or repository permission. Otherwise, if cloning succeeds but files cannot be decrypted, restore access to the correct match password.
- If assets are retrieved but the identity is missing in the build task, correct the task’s user or Keychain context. Otherwise, if the identity is present, continue to profile and target checks.
- If only one target fails, compare that target’s Bundle ID and profile mapping. Otherwise, if all targets fail after a toolchain change, verify the selected Xcode and command-line environment.
- If the profile contents do not meet the target’s requirements, update or regenerate that profile. Otherwise, preserve the existing signing assets and fix the project or task configuration.
| Observed result | Likely area to inspect | Safer next action |
|---|---|---|
| Git clone or fetch fails | URL, network, SSH identity, repository access | Restore access for the build user and retry |
| Clone works, decryption fails | Match password or encrypted repository content | Check secret availability without exposing it |
| Match finishes, identity is unavailable | Keychain, execution user, private key | Inspect the identity in the build task context |
| Identity is available, one target fails | Bundle ID, profile type, target mapping | Inspect that target’s effective signing settings |
| Local build works, remote result differs | Task environment or Xcode selection | Compare the actual remote command context |
After the repair, validate in a controlled sequence. First rerun the intended match lane, using read-only mode when the goal is to verify existing assets rather than create or modify them. For example, the documented action supports a command such as bundle exec fastlane match appstore --readonly; choose the match type that corresponds to your build. Next inspect the signing identity and profile from the build context. Then build the specific failing target and inspect the resulting archive, not only the successful match output.
Record the environment category, task execution method, effective user, Xcode selection, and verification result in your team’s runbook. Keep it factual: record what that environment did, not a universal claim about remote Macs. If you need help with the remote environment itself, MangoVM’s help page provides a place to check service-related support information.
Decide whether to keep repairing the current setup
A local Mac can be the simplest choice when you already have the hardware, control its Keychain, and build infrequently. A hosted runner can reduce machine maintenance, but its task environment and persistence may differ from a dedicated machine. A remote Mac gives you a persistent macOS environment, but you still need to manage Git credentials, secrets, Keychain access, and profile mappings correctly.
The trade-off is operational, not just technical. The current setup may require you to keep a local Mac available, maintain a runner’s signing context, or repeatedly reconstruct state after environment changes. A remote Mac does not remove signing responsibilities, but it can give you a stable place to keep and verify the build process. If your local build is sound and remote signing failures keep coming from inconsistent task contexts, compare the effort of maintaining that setup with a dedicated remote environment. MangoVM’s remote Mac options are one option to evaluate; if you need only occasional builds or depend on a physical device connection, keeping your current local workflow may be the better fit.
Frequently asked questions
What should I check when fastlane match cannot decrypt on a new Mac?
First confirm that the remote job can reach and clone the configured certificate repository. If cloning succeeds but decryption fails, check that the same match password used to encrypt the repository is available to the process running fastlane. Do not paste the password into logs or commit it to the project; provide it through your approved secret mechanism.
How can I tell whether a remote Mac has the match private key?
Run the identity check in the same macOS user and task context that launches the build. A certificate file on disk is not proof that its identity is installed, and an installed certificate is not proof that the corresponding private key is available. Check the command output and the Keychain selected by that process before changing certificates in the shared repository.
What should I do when fastlane match says the Provisioning Profile does not match?
Compare the profile's App ID with the target's Bundle ID, then check the profile type and the signing certificate it includes. Inspect the failing target's build settings and the profile actually selected for that target. Update or regenerate a profile only when those checks show that its contents cannot satisfy the target's requirements.
Why does Keychain access fail under SSH or CI when it works in Remote Desktop?
Those sessions can run with different users, login states, environment variables, or Keychain access conditions. Reproduce the check from the exact SSH command, CI job, or launch context that performs the build. If the identity is visible only in an interactive session, fix the task's Keychain setup rather than assuming match failed to download the certificate.
Further reading
Troubleshoot Signing Builds on a Dedicated Mac
Run your iOS signing workflow on a dedicated physical Mac mini and keep your toolchain, Keychain, and build environment in place between runs.
