Set up Firebase App DistributionAndroid
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
Open the Firebase console
Go to console.firebase.google.com and select (or create) your project. - 2
Add an Android app
Click Add app → Android and enter the package name. It must matchapplicationIdinandroid/app/build.gradleexactly, including any flavor suffix such as.staging(Add Firebase to Android). - 3
Copy the App ID
Open Project settings → General → Your apps, copy the App ID (1:1234567890:android:abc123…) and put it inFIREBASE_ANDROID_<ENV>_APP_ID.
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
Option A: User token (recommended)
Run once to create FIREBASE_TOKEN (“firebase login:ci”).
npm install -g firebase-toolsfirebase --versionReact Native's Gradle/Xcode build runs Node to bundle JavaScript; also needed for the Firebase CLI.
winget install OpenJS.NodeJS.LTSnode --versionRequired for AI tests. Install the Firebase CLI, then sign in with the account that opted in to App Testing:
~/my-app $ npm install -g firebase-tools~/my-app $ firebase login:ciVisit 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"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:
| Role | Why |
|---|---|
| Firebase App Distribution Admin | upload releases, manage testers/groups |
| Firebase Test Lab Admin | device runs |
| Gemini for Google Cloud User | App Testing agent runs on Gemini |
| Service Usage Consumer | call 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 $ 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
- FirebaseDistribute Android apps to testers using fastlanefirebase.google.com/docs/app-distribution/android/distribute-fastlane
- FirebaseAdd Firebase to your Android projectfirebase.google.com/docs/android/setup
- FirebaseManage testers and groupsfirebase.google.com/docs/app-distribution/add-remove-testers
- FirebaseFirebase CLI referencefirebase.google.com/docs/cli
- Google CloudCreate service accountscloud.google.com/iam/docs/service-accounts-create
- Google CloudEnable an APIcloud.google.com/apis/docs/getting-started#enabling_apis