Mobile Fastlane

Build and distributeAndroid

Last updated 2026-10-07

Run the Android lanes through Bundler from the project root. Start with doctor: it catches configuration mistakes in seconds, before a multi-minute Gradle build.

  1. 1

    bundle exec fastlane android doctor environment:staging

    Validates config, Gradle wrapper, Gradle task, artifact type, Firebase app id/groups/credentials and AI test setup.
    my-app — zsh
    ~/my-app $ bundle exec fastlane android doctor environment:staging
    [14:47:49]: --- Android Distribution Doctor ---
    [14:48:03]: Flavor mode: disabled
    [14:48:03]: Firebase App Testing Agent: ENABLED (1 test case ID(s) configured, devices: model=a54x,version=34,...)
    [14:48:03]: Android staging configuration is valid.
  2. 2

    bundle exec fastlane android info environment:staging

    Prints the resolved configuration. Secrets are never printed.
    my-app — zsh
    ~/my-app $ bundle exec fastlane android info environment:staging
    [14:48:03]: --- Android Distribution Information ---
    Project: MyApp
    Environment: staging
    Project directory: /Users/you/my-app/android
    Flavor mode: false
    Gradle task: assembleRelease
    Artifact type: APK
    Artifact glob: android/app/build/outputs/apk/release/*.apk
    Firebase enabled: true
    Firebase App Testing Agent: ENABLED
  3. 3

    bundle exec fastlane android build environment:staging

    Runs the Gradle build, finds the artifact and copies it to dist/ under a readable name.
    my-app — zsh
    ~/my-app $ bundle exec fastlane android build environment:staging
    [14:02:11]: --- Android Build — STAGING ---
    [14:02:11]: Gradle project: /Users/you/my-app/android
    [14:02:11]: Gradle task: assembleRelease
    [14:06:40]: BUILD SUCCESSFUL in 4m 29s
    [14:06:41]: Android build completed.
    [14:06:41]: Artifact: dist/MyApp-staging-v1.4.0-57.apk
  4. 4

    bundle exec fastlane android distribute environment:staging

    The full pipeline (see How it works).

Shortcuts and options

Option / laneEffect
android development | staging | uat | productionShortcut for distribute environment:<name>
environment:<name>Selects the environment (default: APP_ENV, then project.default_environment)
gradle_flags:"--stacktrace"Overrides android.build.gradle_options for one run
Shell
bundle exec fastlane android staging
bundle exec fastlane android distribute environment:staging gradle_flags:"--stacktrace"
Tip: prefer menus? bundle exec fastlane setup (see the setup wizard) asks for the environment, flavor and APK/AAB, then runs these same lanes.

Official documentation

Was this helpful?