cloud-arrow-upFirebase App Distribution (Android)

Upload Flutter Android apps to Firebase App Distribution for manual and automated testing with GitHub Actions

When the team needs to quickly test a new Android build before publishing to the store, I use Firebase App Distribution. I also combine it with GitHub Actions to automatically build and release test builds after each code push.

My goals are:

  • Fast internal testing.

  • Standardize the APK build and distribution flow.

  • Automate CI/CD to reduce manual work.

Prepare testers in Firebase Console

Step 1: Create a tester group

Go to: Firebase Consolearrow-up-right

Open App Distribution -> Get started -> Testers & Groups:

  • Create a group (for example: wong-test).

  • Add tester emails to the group.

After a build is uploaded successfully, testers will receive an email invitation to install the app.

Step 2: Make sure Firebase config files match the correct project

In your Flutter project, check and replace these files correctly:

android/app/google-services.json
ios/Runner/GoogleService-Info.plist

If you change the Firebase project, you need to replace both files accordingly.

Install required tools on local machine

Step 1: Add Flutter pub cache to PATH

Step 2: Install Firebase CLI

Step 3: Login to Firebase and verify projects

Configure FlutterFire for Android and iOS

Run:

Note: your-project-id is the Project ID in Firebase Project settings -> General.

Update Gradle for Google Services plugin

In android/build.gradle, add:

If your project already has this block, just verify the plugin version.

Create CI credentials from Google Cloud

Go to Google Cloud Console -> IAM & Admin -> Service Accounts:

  1. Create a new service account, for example ci-app-distribution.

  2. Assign role: Firebase App Distribution Admin.

  3. Open that service account -> Keys -> Add key -> Create new key -> choose JSON.

  4. Download the JSON key file and keep it secret (do not commit to git).

Configure GitHub Secrets for CI/CD

Go to GitHub -> Repository -> Settings -> Secrets and variables -> Actions and add:

  • APP_ID: Firebase App ID of your Android app (format 1:1234567890:android:abcxyz...)

  • FIREBASE_TOKEN: token from firebase login:ci

Get token:

Copy the returned token and paste it into the FIREBASE_TOKEN secret.

Manually upload app to Firebase App Distribution

Step 1: Build release APK

Step 2: Upload APK to Firebase

If you want to shorten this long command, you can wrap it in a Makefile target and run one short command instead. See the Make guide here:

terminalMakechevron-right

When upload succeeds, testers will receive an email and can install via Firebase App Tester.

Set up CI/CD with GitHub Actions

Create file:

Example content:

On every code push, this workflow will automatically build and upload the APK to Firebase.

Check CI/CD results

Go to:

  • GitHub -> Actions to view pipeline logs.

  • Firebase Console -> App Distribution to verify published builds.

Important security notes

  • Do not commit service account JSON key files to the repository.

  • Do not hard-code tokens in source code or workflow files.

  • Always use GitHub Secrets for APP_ID, FIREBASE_TOKEN, and other sensitive data.

Conclusion

Firebase App Distribution helps me test new builds much faster before store release. When combined with GitHub Actions, the test release flow becomes almost fully automated. I will soon add an iOS section.

If you also want a full store release workflow, combine this with the Fastlane article:

code-branchFastlane - Google Playchevron-right

Buy Me a Coffeearrow-up-right | Support Me on Ko-fiarrow-up-right

Last updated