Mobile Fastlane

Set up Firebase App DistributionAndroid

Last updated 2026-10-07

Connect your Android app to Firebase App Distribution so the framework can upload builds and notify testers. This page follows Google's guide Distribute Android apps to testers using fastlane.

Step 1: Register the app in Firebase

  1. 1

    Open the Firebase console

    Go to console.firebase.google.com and select (or create) your project.
  2. 2

    Add an Android app

    Click Add app → Android and enter the package name. It must match applicationId in android/app/build.gradle exactly, including any flavor suffix such as .staging (Add Firebase to Android).
  3. 3

    Copy the App ID

    Open Project settings → General → Your apps, copy the App ID (1:1234567890:android:abc123…) and put it in FIREBASE_ANDROID_<ENV>_APP_ID.
Caution: registering the wrong package name is the most common setup error. Each flavor with its own applicationIdSuffix needs its own Firebase app.

Step 2: Create a tester group

In App Distribution → Testers & Groups, create a group (e.g. qa-team) and add people. Then put the group alias (not the display name) in FIREBASE_ANDROID_<ENV>_GROUPS. See Manage testers and groups.

Step 3: Authenticate

Install the Firebase CLI first
Firebase CLIlatest

Run once to create FIREBASE_TOKEN (“firebase login:ci”).

npm install -g firebase-tools
Verify: firebase --version
Node.jsLTS

React Native's Gradle/Xcode build runs Node to bundle JavaScript; also needed for the Firebase CLI.

winget install OpenJS.NodeJS.LTS
Verify: node --version
Official install guide

Required for AI tests. Install the Firebase CLI, then sign in with the account that opted in to App Testing:

my-app — zsh
~/my-app $ npm install -g firebase-tools
~/my-app $ firebase login:ci
Visit this URL on this device to log in:
https://accounts.google.com/o/oauth2/auth?client_id=563584335869-...
Waiting for authentication...
✔ Success! Use this token to login on a CI server:
 
1//0gXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Example: firebase deploy --token "$FIREBASE_TOKEN"
Copy the printed 1//… value into FIREBASE_TOKEN in .env (or a CI secret).
Warning: treat the token like a password. It acts as your Google account for Firebase.

Option B: Service account

Upload and distribution only (no AI tests). In Google Cloud → IAM & Admin → Service accounts, create e.g. fastlane-distribution (Create service accounts) with these roles:

RoleWhy
Firebase App Distribution Adminupload releases, manage testers/groups
Firebase Test Lab Admindevice runs
Gemini for Google Cloud UserApp Testing agent runs on Gemini
Service Usage Consumercall enabled APIs

Create a JSON key (Create service account keys), save it as fastlane/firebase-service-account-<name>.json (git-ignored) and point FIREBASE_SERVICE_CREDENTIALS_FILE at it.

Step 4: Enable the APIs

In Google Cloud → APIs & Services → Library, enable the following for the Firebase project (Enable an API):

  • Firebase App Distribution API
  • Cloud Testing API
  • Cloud Tool Results API
  • Gemini for Google Cloud API

Step 5: Verify

my-app — zsh
~/my-app $ bundle exec fastlane android doctor environment:staging
[09:31:20]: --- Android Distribution Doctor ---
[09:31:34]: Flavor mode: disabled
[09:31:34]: Firebase App Testing Agent: ENABLED (1 test case ID(s) configured)
[09:31:34]: Android staging configuration is valid.

Next steps

Official documentation

Was this helpful?