Automate app builds and store uploads with fastlane
Short answer: fastlane is an open-source tool that automates the repetitive parts of shipping mobile apps: building, code signing, taking screenshots, uploading to TestFlight or a Google Play testing track, and pushing store metadata. You describe each release process as a "lane" in a file in your repository, then run it with one command on a developer's machine or in CI. For a small business app, the biggest win is removing the dependency on one person's laptop and login. Use an App Store Connect API key and a dedicated Google service account so the pipeline doesn't rely on anyone's personal account or two-factor codes.
The problem it solves
In many small teams, releasing an app looks like this: one developer opens Xcode, archives, waits, uploads, logs in to App Store Connect, fills in "what's new", then does a similar dance in Play Console. If that person is on holiday, the release waits. Steps get missed: the build number isn't increased, the wrong signing certificate is picked, or Android's release notes go out in one language only.
fastlane's documentation describes it as a way to automate beta deployments and releases for iOS and Android apps, handling tasks such as screenshots, code signing and releasing. The point isn't speed for its own sake. It's that every release follows the same steps, written down in code.
How it's organised
Configuration lives in a fastlane folder in your project:
- Fastfile defines lanes, such as
betaandrelease, each a list of actions. - Appfile holds identifiers like your app's bundle ID or package name.
A typical iOS beta lane increments the build number, builds and signs the app, and uploads it to TestFlight. A typical Android beta lane builds an app bundle and uploads it to an internal or closed testing track. Each lane is run with fastlane beta or similar, and fastlane's docs list integrations for common CI services, including GitHub Actions and GitLab CI.
iOS: use an App Store Connect API key
Historically fastlane signed in with an Apple ID and password, using a web session. Its documentation still supports that, but recommends API key authentication when possible, listing benefits including no two-factor prompts, better performance, a documented API and increased reliability.
To set this up, an account holder or admin creates an API key in App Store Connect; fastlane recommends a Team key. You store the key ID, issuer ID and private key file as secrets in your CI system, and your lanes pass them to fastlane's actions.
fastlane's table of supported tools shows API key support for the main release tools, including uploads to TestFlight, store submissions, signing and certificate management, while a few older tools, such as app creation and push certificate generation, don't support it. Plan for those to stay manual or to use a separate login.
For code signing, fastlane includes match, which keeps certificates and profiles in a shared, encrypted location so every machine signs the same way. That removes the "it only builds on Sam's Mac" problem.
Android: use a dedicated service account
For Google Play, fastlane's upload_to_play_store action uploads binaries and app bundles, updates metadata and screenshots, selects testing tracks and promotes builds to production. Setup means creating a Google Cloud service account and giving it access in Play Console. fastlane's documentation suggests a dedicated service account for fastlane rather than reusing one created for something else.
Store the service account's JSON key as a CI secret, never in the repository, and give the account only the permissions it needs for the apps it manages.
A sensible first pipeline
Don't automate everything on day one. A good first goal:
- Beta lanes for both platforms. Every merge to main builds and uploads to TestFlight and an internal testing track.
- Automatic build numbers. Read the latest build number from the store or use the CI run number, so uploads aren't rejected for duplicates.
- Release notes from a file. Keep "what's new" text in the repository, in each store language you support, so it's reviewed like code.
- Notifications. Post the result to your team chat, with a link to the build.
Once that's reliable, add a release lane that promotes a tested build, uploads metadata and screenshots, and, if you use them, starts a staged rollout. Keep the final "submit for review" or "release to production" step manual at first, so a person still decides when customers get an update.
Keep secrets and access tidy
Automation is only as safe as its credentials:
- Keep API keys, the service account key and signing passphrases in your CI system's secret storage.
- Limit who can trigger release lanes, especially production ones.
- Rotate keys when someone with access leaves, and remove unused keys.
- Record in your project notes who owns the Apple developer account and Play Console account, so access doesn't vanish with a former contractor.
An illustrative example
A café chain in Cork has a loyalty and ordering app built by a two-person team. Releases took most of a day and only one developer could do them. They add fastlane with beta lanes for both stores, an App Store Connect Team API key, match for signing and a dedicated Play service account, all stored as CI secrets. Every merge to main now reaches internal testers within the hour, and a release lane promotes the tested build after the owner signs off.
FAQ
Do we need a Mac for iOS builds?
Yes, iOS builds need macOS, either a team Mac or a macOS runner in your CI service.
Is fastlane only for native apps?
No. Its docs include sections for React Native and Flutter projects.
Can fastlane submit apps for review automatically?
It can upload and submit, but many teams keep that step manual so a person checks the release first.
Does fastlane cost anything?
The tool is open source. Your CI service and macOS runners may have their own costs, so check before switching.
If your app releases depend on one person and one laptop and you'd like them automated, tell us how you release today.