Fastlane Match on an Inherited iOS App
Fastlane match is a tool that keeps your iOS signing certificate and provisioning profiles in one encrypted, shared place, so every developer and every build server signs with the same identity. On a new project it creates what it needs from nothing. On an app you inherited, the same first run can add a second set of credentials beside the working one, or tempt you into a clean-up command that disables old test builds, so the order of operations matters more than the commands.

The pages that rank for this term are mostly Stack Overflow threads and GitHub issues about one specific error, plus older how-to posts, including a 2018 write-up that tricks match into accepting existing certificates by opening its encrypted repository by hand in a Ruby shell. The official documentation now has a supported import command, so that workaround is obsolete. None of the pages I read covers the decision a new owner faces, which is what to check first, whether to nuke, and how to stop a build server from creating credentials on its own. This article does, and every command in it comes from the current fastlane documentation.
What does fastlane match actually do?
Match creates the certificates and provisioning profiles your app needs, stores them in a location you control, and installs them on any machine that runs it. According to the fastlane documentation the storage can be a private git repository, a Google Cloud Storage bucket or an Amazon S3 bucket, and its stated goal is to share one code signing identity across the team, which cuts the duplicate certificates and profiles that pile up when every developer makes their own.
It also repairs problems, since the documentation says match automatically fixes broken and expired credentials, and it argues that Xcode sometimes revokes certificates, which breaks a setup and fails builds. Setting profiles explicitly, it says, makes builds more predictable than the Automatic setting. You may or may not agree, but on a rescued app the practical point holds: a build that signs with the same files on your laptop and on the build server is far easier to debug than one where each machine negotiates its own identity.
Match still talks to the Developer Portal, so it needs either an Apple ID login or an App Store Connect API key, and the account it uses needs a role that can manage certificates. If you haven’t settled who owns the Apple account, start with our notes on the iOS distribution certificate, which cover which roles can create and revoke one.
Why is adopting match riskier on an inherited app?
A new project has nothing to break, while an inherited app already has a certificate, some profiles and possibly a few build channels that depend on them. The setup instructions assume a blank slate, and that assumption is where the damage happens.
Read the documentation’s sequence, which has you run fastlane match init and then says that before running match for the first time you should consider clearing your existing profiles and certificates with the nuke command. After that you run fastlane match appstore and fastlane match development, which create a new certificate and profile if required. For a project you control and understand, that is reasonable. For one you don’t understand yet, it means revoking credentials you haven’t inventoried in order to adopt a tool you installed an hour ago.
Two quieter risks sit behind it. The first is a second certificate: because match creates a certificate if required, running it on an account where the working certificate isn’t in match storage can add a new one next to it. The second is the private key, since a certificate in the portal is useless without the key generated with its signing request, and that key may live only on the previous developer’s laptop. Our article on a provisioning profile that doesn’t include the certificate shows how often that missing key sits behind a release-day failure.
What should you check before running anything?
You should be able to answer four questions, and none of them touches the build.
- Which certificates exist on the account, and which one signs the version that is on the App Store right now?
- Do you have the private key for that certificate, or does it exist only on a machine you can’t reach?
- Has anyone distributed builds through Ad Hoc or Enterprise profiles, for testers or for an internal tool?
- Which Apple ID or API key will match use, and does that account hold a role that can manage certificates?
The third question is the one people skip. The nuke documentation is explicit that builds distributed through Ad Hoc or Enterprise are disabled afterward and have to be re-uploaded. An inherited app often has a forgotten QA channel that a client’s staff install from a link, and you only learn it exists when it stops working.
The fourth question is about authentication. The match action accepts an App Store Connect API key through api_key_path or api_key, as well as a username, and a key suits a build server better because it doesn’t depend on one person’s password and two-factor device. If the account still belongs to a former agency, fix that first, because certificates don’t move with an app between accounts. Our notes on Apple app transfer explain what stops working afterward.
How do you import the existing certificate into match?
You export the files you already have, point match at your storage, and run the import command so match stores them without creating anything new. The documentation describes fastlane match import as the way to encrypt and store a certificate (.cer), the private key (.p12) and the provisioning profiles (.mobileprovision), and it prompts you for the three file paths.

The certificate comes from the Developer Portal, and the private key comes from the Keychain of the Mac that made the original signing request, where Keychain Access can export the pair as a .p12 file. If no machine can produce that file, you’ve learned something important: the key is gone, import isn’t possible, and a fresh certificate is the only route.
With the files in hand, run fastlane match init first so the Matchfile exists. The documentation’s example holds the repository URL, the branch, the app identifier and the account username, and it notes that init doesn’t read or modify any certificate or profile. Then run the import, where the documentation says match first validates the certificate against the Developer Portal and only then writes the certificate, key and profiles to your storage, which gives you a built-in check that you imported a credential that is still valid.
There’s a variant for when you can’t reach the portal. The --skip_certificate_matching true option skips the login and imports what you hand it. The documentation warns you to make sure the files match the type (development, adhoc, appstore, enterprise or developer_id) and aren’t revoked or expired, so treat the result as unverified until a real build signs with it. Afterwards, run fastlane match appstore --readonly on a second machine, and if the app archives and uploads, the import worked.
Should you run match nuke on an app you didn’t build?
Usually not as a first step, and never without reading the list it shows you. The documentation presents nuke for teams with a messy account full of invalid, expired or Xcode-managed profiles and certificates. It revokes certificates and provisioning profiles for the environment you name, with separate commands for development, distribution and enterprise.
The documentation also says what survives. Apps already in the App Store or TestFlight keep working, so customers won’t notice. Builds distributed through Ad Hoc or Enterprise are disabled. Match then asks you to confirm a list of profiles and certificates it will delete, and that confirmation is the whole safety net.
On an inherited account that list is the first honest inventory you’ll get. Anything on it you can’t explain is a reason to stop and ask, because a distribution certificate belongs to the team, so revoking it affects every app signed by that team and not only the one you’re rescuing. For cleaning match’s own storage without touching the account, the documentation lists a safe_remove_certs setting that removes certificates from the repository during nuke without revoking them on the Developer Portal.
A fair rule is to nuke only when you’ve confirmed that nothing outside the store path depends on the credentials, when you hold or can recreate every key you need, and when the Account Holder has agreed. Until all three hold, importing the working certificate is the safer path.
Where should the encrypted credentials live?
They should live somewhere your company owns and can recover, and who holds the keys to that place matters more than which of the three storage modes you pick. For git storage, files are encrypted with OpenSSL using a passphrase, and the documentation says to remember it because you’ll need it on every new machine.

The passphrase is where inherited projects get stuck. If the previous developer set it and left, the repository is a locked box, and the only path forward is new credentials. Store the passphrase in the team’s secret manager, give the Account Holder a second copy, and supply it to build servers through the MATCH_PASSWORD environment variable, which the documentation names for avoiding the prompt. The command fastlane match change_password re-encrypts the repository with a new passphrase, so you can rotate it after a contractor leaves.
Git hosting has its own traps, and the documentation covers the common ones. If your machine authenticates to GitHub over SSH, you need a git URL rather than an https URL or you’ll hit an authentication error. For build servers it describes a basic authorization header, a bearer token for Azure DevOps and a deploy key, noting that the header options need git 2.31 or later.
The documentation also addresses the worry about private keys in a repository. It says an App Store profile can’t be used for anything unless Apple re-signs it through App Review, and an attacker would also need your App Store Connect credentials, which aren’t stored in git. Enterprise profiles are the dangerous case, since they can reach an unlimited number of devices. Keep the repository private, turn on two-factor authentication for everyone who can read it, and leave enterprise profiles out unless you really distribute that way.
For several apps from one team, the documentation says one repository and branch can serve them all, with certificates reused and a separate profile created per app. Extensions and widgets go in as a comma-separated list of bundle identifiers, and forgotten extension identifiers are a common hiding place on rescued apps.
How do you stop the build server from creating new credentials?
You run match in readonly mode on CI, so a build can fetch what exists but can never generate a new certificate or profile. The documentation shows the flag as fastlane match development --readonly and describes it as fetching existing certificates and profiles without generating new ones. Inside a Fastfile, the same behavior is the readonly option.

The usual pattern is that a person runs match without the flag on a trusted machine when a profile has to change, and CI runs it with the flag every time. The release lane then holds one line, match(type: "appstore", readonly: is_ci). If a profile is missing, CI stops with a clear error instead of quietly creating a certificate nobody tracks, which is the most common cause of the duplicate-certificate mess you may have found when you took over.
CI needs its machine details right too. The documentation says profiles are installed in ~/Library/Developer/Xcode/UserData/Provisioning Profiles for Xcode 16 and later, and in ~/Library/MobileDevice/Provisioning Profiles for earlier versions. If a server has both Xcode 15 and 16 installed, select the right one with the xcode_select or xcodes action before calling match, because fastlane reads the system default. Keychain access is the other surprise: match sets a partition list so Xcode doesn’t prompt to allow signing, the step can be slow, and keychain_name lets you point a build server at a dedicated keychain.
What goes wrong after you adopt match?
Three things come up often: Xcode’s signing settings override match, new devices are missing from development profiles, and an expiring certificate catches nobody’s attention. Each is easy once you know it exists.
The project settings come first, because match installs the files but the Xcode project still decides which identity and profile each configuration uses. If Release is set to Automatic signing, Xcode may pick its own Apple Development certificate and ignore what match installed, which brings back the “doesn’t include certificate” failure. Switch Release to manual signing, point it at the profile name match created, and keep Debug separate. The profile_name option lets you give the provisioning profile a readable custom name.
Devices come second, since development and ad hoc profiles contain a device list and a new tester’s phone isn’t in the profile until it is renewed. The force_for_new_devices option renews profiles when the device count on the portal has changed, and neither option matters for App Store builds, which carry no device list.
Renewal comes third, where the renew_expired_certs option removes the expired certificate from match storage and creates a new one, but the documentation says the old certificate isn’t revoked on the portal, and that you should run nuke if you need to free up certificate slots. Decide in advance who gets the expiry notice and who runs the renewal, and write that in the repository’s README.
Treat the first month after adoption as a monitored period: run a real archive and upload from CI, add a test device and confirm it lands in a development profile, and check that Release really uses the profile you expect. Our mobile app maintenance work at RapidLabs includes exactly this check, because signing setups are where small oversights stay hidden until a deadline.
What should a clean signing setup look like at handover?
It should be boring, written down and recoverable by someone who has never met the person who set it up. The test is whether a new engineer could ship a release within an afternoon if the one who configured it disappeared tomorrow.
Concretely, that means a repository or bucket your company owns, a passphrase held in a secret manager and by the Account Holder, a Matchfile checked into the app’s repository, and CI running with readonly so credentials only change when a person decides they should. It also means the Apple account has more than one Admin, the certificate expiry date is on a calendar, and the bundle identifiers match manages include every extension the app ships.
Whether to adopt match at all depends on how much of that you already have. A solo developer with one certificate and a working key may be fine with Xcode’s own signing, while a team with several machines, a build server and a history of release-day signing failures gains a lot from a single source of truth, provided the adoption follows the order above. When the app is unstable in other ways too, the signing clean-up is usually one step of a broader app takeover, and the account inventory is the first thing a senior engineer at RapidLabs does there.
Frequently asked questions
What does fastlane match do?
Fastlane match creates the certificates and provisioning profiles an iOS app needs and stores them in one shared place, which can be a private git repository, a Google Cloud bucket or an Amazon S3 bucket. Everyone with access to that storage signs with the same identity, and the fastlane documentation says match also repairs broken and expired credentials.
Can I use fastlane match with an existing certificate?
Yes, and the match documentation describes a fastlane match import command that takes your certificate file, your private key and your provisioning profiles, validates the certificate against the Apple Developer portal, and stores everything encrypted in your match storage. That route keeps the certificate already in use, so you don't have to revoke anything just to adopt match.
Is it safe to run fastlane match nuke on an inherited app?
Only after you've read exactly what it will delete. The fastlane documentation says apps already in the App Store or TestFlight keep working after a nuke, but builds distributed through Ad Hoc or Enterprise are disabled and have to be re-uploaded. It asks you to confirm a list of certificates and profiles first, and on an account you didn't set up yourself that list deserves a line-by-line read.
What does the readonly option in fastlane match do?
Readonly mode makes match fetch the existing certificates and profiles without generating new ones. The documentation shows it as a flag, fastlane match development --readonly, and as an option inside a lane. It's the setting to use on a build server, because a CI job should never be able to create a new certificate by accident.
Where should I store the fastlane match passphrase?
In your team's secret manager, with a second copy held by the account owner. With git storage, match encrypts every file with OpenSSL, and the documentation says you need the passphrase on each new machine. It can be supplied through the MATCH_PASSWORD environment variable, which is how a build server normally gets it without a prompt.
Stuck on a release, a crash, or an app nobody owns?
RapidLabs maintains, stabilizes and takes over existing iOS and Android apps. Send the app link, the stack, and what is going wrong, and you will get a plain answer on whether you need help at all.
Talk to a senior engineer about your app