Stay organized with collectionsSave and categorize content based on your preferences.
You can integrateApp Distributioninto your Android build process using theApp DistributionGradle plugin. The plugin lets you specify your testers and
release notes in your app's Gradle file, letting you configure distributions
for different build types and variants of your app.
This guide describes how to distribute APKs to testers using theApp DistributionGradle plugin.
If you aren't using any other Firebase products, you only have to create a
project and register your app. However, if you decide to use additional
products in the future, be sure to complete all of the steps on the page
linked above.
Step 1. Set up your Android project
In yourroot-level (project-level)Gradle file
(<project>/build.gradle.ktsor<project>/build.gradle), add theApp DistributionGradle plugin as a dependency:
Kotlin
plugins{// ...id("com.android.application")version"7.3.0"applyfalse// Make sure that you have the Google services Gradle plugin dependencyid("com.google.gms.google-services")version"4.4.3"applyfalse// Add the dependency for theApp DistributionGradle pluginid("com.google.firebase.appdistribution")version"5.1.1"applyfalse}
Groovy
plugins{// ...id'com.android.application'version'7.3.0'applyfalse// Make sure that you have the Google services Gradle plugin dependencyid'com.google.gms.google-services'version'4.4.3'applyfalse// Add the dependency for theApp DistributionGradle pluginid'com.google.firebase.appdistribution'version'5.1.1'applyfalse}
In yourmodule (app-level)Gradle file (usually<project>/<app-module>/build.gradle.ktsor<project>/<app-module>/build.gradle),
add theApp DistributionGradle plugin:
Kotlin
plugins{id("com.android.application")// Make sure that you have the Google services Gradle pluginid("com.google.gms.google-services")// Add theApp DistributionGradle pluginid("com.google.firebase.appdistribution")}
Groovy
plugins{id'com.android.application'// Make sure that you have the Google services Gradle pluginid'com.google.gms.google-services'// Add theApp DistributionGradle pluginid'com.google.firebase.appdistribution'}
If you're behind a corporate proxy or firewall, add the followingJava system propertythat enablesApp Distributionto upload your distributions to Firebase:
Before you can use the Gradle plugin, you must first authenticate with your
Firebase project in one of the following ways. By default, the Gradle plugin
looks for credentials from theFirebaseCLI if no other authentication
method is used.
Use Firebase service account credentials
Authenticating with a service account allows you to flexibly use the plugin with
your continuous integration (CI) system. There are two ways to provide service
account credentials:
Pass your service account key file tobuild.gradle. You might find this
method convenient if you already have your service account key file in your
build environment.
Set the environment variableGOOGLE_APPLICATION_CREDENTIALSto point to
your service account key file. You might prefer this method if you
already have Application Default Credentials (ADC)
configured for another Google service (e.g.,Google Cloud).
To authenticate using service account credentials:
Create a private json key and move the key to a location accessible to your
build environment.Be sure to keep this file somewhere safe, as it grants administrator
access toApp Distributionin your Firebase project.
Skip this step if you created your app after September 20,
2019: In the Google APIs console, enable theFirebase App DistributionAPI.When prompted, select the project with the same name as your Firebase
project.
Provide or locate your service account credentials:
To pass Gradle your service account key, in yourbuild.gradlefile, set the propertyserviceCredentialsFileto the private key JSON
file.
To locate your credentials with ADC, set the environment variableGOOGLE_APPLICATION_CREDENTIALSto the path for the private key JSON
file. For example:
In yourmodule (app-level)Gradle file (usually<project>/<app-module>/build.gradle.ktsor<project>/<app-module>/build.gradle), configureApp Distributionby adding at
least onefirebaseAppDistributionsection.
For example, to distribute thereleasebuild to testers, follow these
instructions::
For example, to distributedebugandreleasebuilds in "demo" and "full"
product flavors, follow these instructions:
Kotlin
importcom.google.firebase.appdistribution.gradle.firebaseAppDistributionandroid{// ...buildTypes{getByName("debug"){...}getByName("release"){...}}flavorDimensions+="version"productFlavors{create("demo"){dimension="version"firebaseAppDistribution{releaseNotes="Release notes for demo version"testers="demo@testers.com"}}create("full"){dimension="version"firebaseAppDistribution{releaseNotes="Release notes for full version"testers="full@testers.com"}}}// ...}
Groovy
android{//...buildTypes{debug{...}release{...}}flavorDimensions"version"productFlavors{demo{dimension"version"firebaseAppDistribution{releaseNotes="Release notes for demo version"testers="demo@testers.com"}}full{dimension"version"firebaseAppDistribution{releaseNotes="Release notes for full version"testers="full@testers.com"}}}//...}
Use the following parameters to configure the distribution:
App DistributionBuild Parameters
appId
Your app's Firebase App ID. Required only if you don't have the
Google Services Gradle plugin installed. You can find the App ID in
thegoogle-services.jsonfile or in theFirebaseconsole on theGeneral Settings page. The value in yourbuild.gradlefile overrides the value output from thegoogle-servicesplugin.
appId="1:1234567890:android:321abc456def7890"
serviceCredentialsFile
The path to your service account private key JSON file. Required only
if you use service account authentication.
artifactType
Specifies your app's file type. Can be set to"AAB"or"APK".
artifactPath
Absolute path to the APK or AAB file you want to upload.
releaseNotesorreleaseNotesFile
Release notes for this build.
You can either specify the release notes directly or the
path to a plain text file.
testersortestersFile
The email addresses of the testers you want to distribute builds
to.
You can specify the testers as a comma-separated list of email
addresses:
Or, you can specify the path to a file containing a comma-separated
list of email addresses:
testersFile="/path/to/testers.txt"
groupsorgroupsFile
The tester groups you want to distribute builds to (seeManage testers).
Groups are specified usinggroup aliases, which you can
find in theTesterstab in the FirebaseApp Distributionconsole.
You can specify the groups as a comma-separated list of group
aliases:
groups="qa-team, android-testers"
Or, you can specify the path to a file containing a comma-separated
list of group aliases:
groupsFile="/path/to/tester-groups.txt"
testDevicesortestDevicesFile
The following distribution types are part of theAutomated tester beta feature.
The test devices you want to distribute builds to (seeAutomated tests).
You can specify the test devices as a semicolon-separated list of
device specifications:
Or, you can specify the path to a file containing a semicolon-separated
list of device specifications:
testDevicesFile="/path/to/testDevices.txt"
testUsername
The username for automatic login to be used duringautomated tests.
testPasswordortestPasswordFile
The password for automatic login to be used duringautomated tests.
Or, you can specify the path to a plain text file containing a password:
testPasswordFile="/path/to/testPassword.txt"
testUsernameResource
Resource name for the username field for automatic login to be used duringautomated tests.
testPasswordResource
Resource name for the password field for automatic login to be used duringautomated tests.
testNonBlocking
Runautomated testsasynchronously. Visit the Firebase console for the automatic test results.
stacktrace
Prints out the stacktrace for user exceptions. This is helpful when
debugging issues.
Step 4. Distribute your app to testers
Finally, to package your test app and invite testers, build the targetsBUILD-VARIANTandappDistributionUploadBUILD-VARIANTwith your
project's Gradle wrapper, whereBUILD-VARIANTis the optional
product flavor and build type you configured in the previous step.
For more information about product flavors, seeConfigure build variants.
For example, to distribute your app using thereleasebuild variant, run the
following command:
Or, if you authenticated with yourGoogle Accountand didn't provide credentials in your Gradle build file, include theFIREBASE_TOKENvariable:
export FIREBASE_TOKEN=1/a1b2c3d4e5f67890./gradlew --stop // Only needed for environment variable changes./gradlew assembleRelease appDistributionUploadRelease
You can also override the values set in yourbuild.gradlefile by passing
command line arguments in the form of--<property-name>=<property-value>. For example:
Once a tester has been added to your Firebase project, you can add them to
individual releases. Testers who are removed will no longer have access to
releases in your project, but may still retain access to your releases
for a window of time.
You can also specify testers using--file="/path/to/testers.txt"instead of--emails.
TheappDistributionAddTestersandappDistributionRemoveTesterstasks
also accept the following arguments:
projectNumber: Your Firebase project number.
serviceCredentialsFile: The path to your Google service credentials file.
This is the same argument used by the upload action.
The Gradle plugin outputs the following links after the release upload. These
links help you manage binaries and ensure that testers and other developers
have the right release:
firebase_console_uri- A link to theFirebaseconsole displaying a
single release. You can share this link with other developers in your
org.
testing_uri- A link to the release in the tester experience
(Android native app) that lets testers view release
notes and install the app onto their device. The tester needs access to
the release in order to use the link.
binary_download_uri- A signed link that directly downloads and
installs the app binary (APK or AAB file). The link expires after one
hour.
Once you distribute your build, it becomes available in theApp Distributiondashboard of theFirebaseconsole for 150 days (five months).
When the build is 30 days from expiring, an expiration notice appears in both
the console and your tester's list of builds on their test device.
Testers who haven't been invited to test the app receive email invitations to
get started, and existing testers receive email notifications that a new build
is ready to test (read thetester set up guidefor instructions on how to install the test
app). You can monitor the status of each tester-whether they accepted the
invitation and whether they downloaded the app-in theFirebaseconsole.
Testers have 30 days to accept an invitation to test the app before it expires.
When an invitation is 5 days from expiring, an expiration notice appears in theFirebaseconsole next to the tester on a release. An invitation can be
renewed by resending it using the drop-down menu on the tester row.
Next steps
Implementin-app feedbackto make it easy for testers to send feedback about your app (including
screenshots).
Learn how to displayin-app alertsto your testers when new builds of your app are available to install.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-05 UTC."],[],[],null,[]]