Fastlane is a tool for automating builds and publishing mobile applications for iOS and Android. Fastlane manages code signing, building, running tests, creating screenshots, and uploading to App Store Connect and Google Play Console. It is the de facto standard for CI/CD in mobile development.
Key Takeaways
Fastlane is an open-source tool that automates routine mobile development tasks: building the application, running tests, creating screenshots, managing certificates, and uploading builds to TestFlight, App Store, and Google Play. Fastlane is written in Ruby and distributed via RubyGems with the command gem install fastlane.
Fastlane appeared in 2015 as an iOS tool but quickly expanded to Android. Today it is an ecosystem of dozens of actions — built-in commands that can be combined into scenarios called lanes. Each lane performs a specific task: for example, build_release builds the release version, and deploy_beta uploads the build to TestFlight.
Fastlane is used by companies such as Uber, Airbnb, Snapchat, Twitter, and Shopify. According to a 2024 survey, more than 60% of iOS developers use Fastlane in their projects. The tool supports both local execution and integration with cloud CI systems, making it the de facto standard for mobile CI/CD.
# Installing Fastlane
sudo gem install fastlane -NV
# Initializing in the project
fastlane init
After initialization, Fastlane creates a fastlane/ directory with three files: Fastfile (scenarios), Appfile (app settings), and Matchfile (certificate settings). This structure remains the same for both platforms — iOS and Android.
The main Fastlane configuration file is Fastfile. It is located in the fastlane/ directory at the project root. Fastfile is written in Ruby: each lane is a named block with a sequence of actions. A lane can accept parameters, call other lanes, and return values.
# fastlane/Fastfile — iOS example
default_platform(:ios)
platform :ios do
desc "Build and upload to TestFlight"
lane :beta do
match(type: "appstore")
gym(scheme: "MyApp", configuration: "Release")
pilot(skip_waiting_for_build: true)
end
desc "Deploy to App Store"
lane :release do
ensure_git_status_clean
match(type: "appstore")
gym(scheme: "MyApp")
deliver(
skip_metadata: true,
skip_screenshots: true
)
push_to_git_remote(tags: true)
end
end
Each lane is run with the command fastlane ios beta or fastlane ios release. Fastfile supports variables, conditions, loops, and external script calls — it is a full Ruby file. Developers can reuse code through private_lane (local methods) and import from other Fastfiles.
Fastlane provides more than 200 built-in actions for most tasks. If the required action does not exist, you can write your own in Ruby or call a shell command using sh("..."). Actions can accept parameters — build settings, paths, access tokens — and return results for use in subsequent steps.
Fastlane for iOS solves three key problems: managing certificates and provisioning profiles, building IPA via Xcode, and publishing to App Store Connect and TestFlight. Each of these tasks is covered by a separate action.
match is an action for certificate management. It stores all certificates and provisioning profiles in an encrypted Git repository. Every developer and CI server use the same set of files, eliminating conflicts and expired certificate issues. Match automatically updates profiles when new devices are added.
sigh creates and downloads a provisioning profile via the Apple Developer Portal. It is used when you need to quickly get a profile for a specific type: development, ad-hoc, or appstore.
gym builds the IPA. Gym wraps xcodebuild with optimal parameters, automatically selects the scheme, configuration, export options, and creates a signed IPA. Example: gym(scheme: "MyApp", export_method: "app-store").
pilot manages TestFlight. It uploads the build, adds testers, and tracks the review status. deliver handles full App Store publishing, including metadata, screenshots, pricing, and versioning.
# Building and publishing an iOS app
lane :deploy_ios do
cocoapods
match(type: "appstore", readonly: true)
gym(scheme: "MyApp", export_method: "app-store")
pilot(changelog: "Bug fixes and performance improvements")
end
Working with App Store Connect requires access tokens. Fastlane supports two authentication methods: App Store Connect API Key (recommended) and Apple ID with two-factor authentication. API keys are more convenient for CI/CD since they do not require interactive password entry.
| Action | Purpose | Manual Equivalent |
|---|---|---|
match | Certificate and profile management | Apple Developer Portal |
sigh | Provisioning profile creation | Xcode + Developer Portal |
gym | IPA build | xcodebuild + xcrun |
pilot | TestFlight upload | Xcode Organizer |
deliver | App Store publishing | App Store Connect Web |
scan | UI tests execution | xcodebuild test |
On Android, Fastlane automates building via Gradle, APK and AAB signing, uploading to Google Play Console, and Firebase App Distribution.
gradle is the main action for Android builds. It calls the Gradle wrapper with the required tasks: gradle(task: "assembleRelease") or gradle(task: "bundleRelease") for AAB. You can pass flags, environment variables, and the path to gradle.properties.
supply uploads APK or AAB to Google Play Console. Supply manages versions, tracks (internal, alpha, beta, production), release notes, pricing, and country distribution. Example: supply(track: "beta", release_status: "completed").
screengrab creates screenshots for Google Play. It runs instrumentation tests that capture screenshots of the app on different devices and languages. The resulting screenshots are uploaded via supply.
# Building and publishing an Android app
lane :deploy_android do
gradle(task: "clean bundleRelease")
supply(
track: "beta",
release_status: "completed",
version_code: 42
)
end
| Action | Purpose | Manual Equivalent |
|---|---|---|
gradle | Build via Gradle | ./gradlew assembleRelease |
supply | Upload to Google Play | Google Play Console Web |
screengrab | Screenshot creation | Manual screenshot + ImageMagick |
firebase_app_distribution | Firebase distribution | Firebase Console Upload |
Fastlane is designed to work in CI/CD pipelines. It correctly handles non-interactive mode, environment variables, and build artifacts. Below are integration examples with popular CI systems.
In GitHub Actions, Fastlane is run as a Ruby script. A typical workflow: install Ruby and Fastlane, configure keys (certificates, API tokens via secrets), and run the lane. iOS requires a macOS runner; Android works on ubuntu-latest.
In GitLab CI, Fastlane is used in .gitlab-ci.yml with a similar setup: install dependencies, run fastlane, and pass artifacts. GitLab CI supports macOS and Linux runners.
Bitrise — a specialized CI/CD for mobile applications — has built-in Fastlane support. Bitrise Workflow can call the Fastlane Step or run custom scripts with fastlane. Bitrise handles certificates through its Code Signing manager.
# Fastfile for CI/CD with conditional test execution
lane :ci_test do
scan(scheme: "MyApp", code_coverage: true)
end
lane :ci_beta do
ensure_git_status_clean
version_bump_podspec(path: "MyApp.podspec")
match(type: "appstore", readonly: true)
gym(scheme: "MyApp", export_method: "app-store")
pilot(distribute_external: true)
end
An important aspect of CI/CD integration is secret storage. Fastlane uses the .env file via dotenv and environment variables. For iOS, critical variables include: MATCH_PASSWORD, FASTLANE_APPLE_API_KEY, FASTLANE_APPLE_API_KEY_ID. For Android: SUPPLY_JSON_KEY_DATA — the contents of the Google Play service account.
Fastlane includes over 200 built-in actions. Below is an overview of the most popular ones with their platform and purpose.
| Action | Platform | Description |
|---|---|---|
gym | iOS | Build IPA with optimized xcodebuild parameters |
match | iOS | Sync certificates and provisioning profiles via Git |
pilot | iOS | Upload build to TestFlight and manage testers |
deliver | iOS | Publish app to App Store with metadata |
scan | iOS | Run unit and UI tests with report generation |
gradle | Android | Run Gradle tasks: assemble, bundle, test |
supply | Android | Upload APK and AAB to Google Play Console |
screengrab | Android | Automatic screenshots for Google Play |
firebase_app_distribution | Android | Distribute builds via Firebase |
snapshot | iOS | Automatic screenshots on simulators for App Store |
increment_build_number | iOS | Auto-increment build number in Xcode project |
appcenter_upload | Both | Upload build to App Center |
To find the required action, use the command fastlane action [name], which displays documentation, parameters, and examples. The full list is available locally: fastlane actions.
Fastlane also supports plugins — community extensions that add new actions. Plugins are installed via fastlane add_plugin [name] and are available in the RubyGems registry. Examples of popular plugins: fastlane-plugin-versioning (version management), fastlane-plugin-sentry (upload debug symbols to Sentry), fastlane-plugin-teams (notifications in Microsoft Teams).
Frequently Asked Questions
Fastlane is a tool for automating builds and publishing mobile applications. It replaces manual operations — building, code signing, and uploading to stores — with a single command. Fastlane reduces release time from hours to minutes and eliminates human errors during publishing.
Yes. Fastlane supports both platforms independently. iOS requires macOS, while Android only requires Linux. You can separate lanes by platform in a single Fastfile: platform :ios do ... end and platform :android do ... end.
Through the match action. It stores encrypted certificates and provisioning profiles in a Git repository. Each developer clones the repository, match decrypts the files using the password from the MATCH_PASSWORD environment variable, and installs them into the keychain. This solves the "it works on my machine" problem.
Yes. Fastlane has a built-in firebase_app_distribution action for uploading APK and IPA to Firebase App Distribution. There is also firebase_app_distribution_add_testers for adding testers. An alternative is the appcenter_upload action for App Center.
Fastlane is installed via RubyGems: gem install fastlane -NV. iOS requires macOS with Xcode; Android requires Linux or macOS with JDK and Android SDK. GitHub Actions has a ready-made ruby/setup-ruby action for installing Ruby and Fastlane. Environment variables are passed via the CI system's secrets.
Fastlane is a library and CLI for automating build and publishing tasks. Bitrise and Jenkins are full CI/CD platforms. Fastlane runs inside them: Jenkins runs Fastlane as a pipeline step, Bitrise calls Fastlane through a dedicated Step. Fastlane does not replace a CI system — it complements it with mobile-specific functionality.
Summary
We will develop a mobile application turnkey
IT Sectr creates iOS and Android applications for startups and businesses since 2017. We will advise you and propose the best solution.
Read also