Fastlane: What It Is, Build Automation and Publishing

Author: IT Sectr Published: 2026-02-13 Reading time: 10 min

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 automates the entire mobile release pipeline: build, test, sign, and publish with a single command
  • Fastfile is a Ruby configuration file that describes lanes — named automation scenarios
  • iOS and Android support — Fastlane works with Xcode, Gradle, App Store Connect, Google Play, TestFlight, and Firebase
  • match and sigh — certificate and provisioning profile management for iOS development
  • CI/CD integration — Fastlane integrates into GitHub Actions, GitLab CI, Bitrise, Jenkins, and CircleCI

Fastlane — What It Is

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.

ruby
# 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.

Fastfile and Lanes

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.

ruby
# 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.

iOS Build Automation

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.

ruby
# 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.

ActionPurposeManual Equivalent
matchCertificate and profile managementApple Developer Portal
sighProvisioning profile creationXcode + Developer Portal
gymIPA buildxcodebuild + xcrun
pilotTestFlight uploadXcode Organizer
deliverApp Store publishingApp Store Connect Web
scanUI tests executionxcodebuild test

Android Build Automation

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.

ruby
# Building and publishing an Android app
lane :deploy_android do
  gradle(task: "clean bundleRelease")
  supply(
    track: "beta",
    release_status: "completed",
    version_code: 42
  )
end
ActionPurposeManual Equivalent
gradleBuild via Gradle./gradlew assembleRelease
supplyUpload to Google PlayGoogle Play Console Web
screengrabScreenshot creationManual screenshot + ImageMagick
firebase_app_distributionFirebase distributionFirebase Console Upload

CI/CD Integration

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.

ruby
# 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.

Popular Fastlane Actions

Fastlane includes over 200 built-in actions. Below is an overview of the most popular ones with their platform and purpose.

ActionPlatformDescription
gymiOSBuild IPA with optimized xcodebuild parameters
matchiOSSync certificates and provisioning profiles via Git
pilotiOSUpload build to TestFlight and manage testers
deliveriOSPublish app to App Store with metadata
scaniOSRun unit and UI tests with report generation
gradleAndroidRun Gradle tasks: assemble, bundle, test
supplyAndroidUpload APK and AAB to Google Play Console
screengrabAndroidAutomatic screenshots for Google Play
firebase_app_distributionAndroidDistribute builds via Firebase
snapshotiOSAutomatic screenshots on simulators for App Store
increment_build_numberiOSAuto-increment build number in Xcode project
appcenter_uploadBothUpload 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

What is Fastlane and why do I need it?

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.

Can I use Fastlane only for Android or only for iOS?

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.

How does Fastlane manage iOS certificates?

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.

Does Fastlane work with Firebase App Distribution?

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.

How do I install Fastlane on a CI server?

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.

How is Fastlane different from Bitrise or Jenkins?

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

  • Fastlane is an open-source tool for automating builds, testing, and publishing mobile apps for iOS and Android
  • Fastfile is a Ruby configuration file that describes lanes — scenarios with a sequence of actions
  • match + gym + pilot — the standard iOS pipeline: certificate management, IPA build, TestFlight upload
  • gradle + supply — the standard Android pipeline: build via Gradle, upload to Google Play Console
  • CI/CD integration — Fastlane integrates into GitHub Actions, GitLab CI, Bitrise, Jenkins, and CircleCI via environment variables
  • 200+ actions — built-in commands for code signing, building, testing, screenshots, publishing, and notifications
  • Plugins — community extensions add new actions: versioning, Sentry, messenger notifications

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.

Discuss the project

Read also