Use App Check with the debug provider on Android Stay organized with collections Save and categorize content based on your preferences.
If, after you have registered your app forApp Check, you want to run yourapp in an environment thatApp Check would normally not classify as valid,such as an emulator during development, or from a continuous integration (CI)environment, you can create a debug build of your app that uses theApp Check debug provider instead of a real attestation provider.
Warning: The debug provider allows access to your Firebase resources fromunverified devices.Don't use the debug provider in production builds of yourapp, anddon't share your debug builds with untrusted parties.Use the debug provider in an emulator
To use the debug provider while running your app in an emulator interactively(during development, for example), do the following:
In yourmodule (app-level) Gradle file(usually
<project>/<app-module>/build.gradle.ktsor<project>/<app-module>/build.gradle),add the dependency for theApp Check library for Android. We recommend using theFirebase Android BoMto control library versioning.dependencies{// Import theBoM for the Firebase platformimplementation(platform("com.google.firebase:firebase-bom:34.7.0"))// Add the dependencies for theApp Check libraries// When using theBoM, you don't specify versions in Firebase library dependenciesimplementation("com.google.firebase:firebase-appcheck-debug")}
By using theFirebase Android BoM, your app will always use compatible versions of Firebase Android libraries.
(Alternative) Add Firebase library dependencies without using theBoM
If you choose not to use theFirebase BoM, you must specify each Firebase library version in its dependency line.
Note that if you usemultiple Firebase libraries in your app, we strongly recommend using theBoM to manage library versions, which ensures that all versions are compatible.
dependencies{// Add the dependencies for theApp Check libraries// When NOT using theBoM, you must specify versions in Firebase library dependenciesimplementation("com.google.firebase:firebase-appcheck-debug:19.0.1")}
In your debug build, configureApp Check to use the debug providerfactory:
Kotlin
Firebase.initialize(context=this)Firebase.appCheck.installAppCheckProviderFactory(DebugAppCheckProviderFactory.getInstance(),)
Java
FirebaseApp.initializeApp(/*context=*/this);FirebaseAppCheckfirebaseAppCheck=FirebaseAppCheck.getInstance();firebaseAppCheck.installAppCheckProviderFactory(DebugAppCheckProviderFactory.getInstance());
Launch the app and trigger a call to a Firebase backend service. A localdebug token will be logged when the SDK tries to send a request to thebackend. For example:
D DebugAppCheckProvider: Enter this debug secret into the allow list inthe Firebase Console for your project: 123a4567-b89c-12d3-e456-789012345678
In theApp Check sectionof theFirebase console, chooseManage debug tokens from your app'soverflow menu. Then, register the debug token you logged in the previousstep.

After you register the token, Firebase backend services will accept it as valid.
Because this token allows access to your Firebase resources without avalid device, it is crucial that you keep it private. Don't commit it to apublic repository, and if a registered token is ever compromised, revoke itimmediately in theFirebase console.
Use the debug provider for unit testing in a CI environment
To use the debug provider for unit testing in a continuous integration (CI)environment, do the following:
In theApp Check sectionof theFirebase console, chooseManage debug tokens from your app'soverflow menu. Then, create a new debug token. You'll need the token in thenext step.
Because this token allows access to your Firebase resources withouta valid device, it is crucial that you keep it private. Don't commit it to apublic repository, and if a registered token is ever compromised, revoke itimmediately in theFirebase console.

Add the debug token you just created to your CI system's secure key store(for example, GitHub Actions'encrypted secrets or Travis CI'sencrypted variables).
If necessary, configure your CI system to make your debug token availablewithin the CI environment as an environment variable. Name the variablesomething like
APP_CHECK_DEBUG_TOKEN_FROM_CI.In yourmodule (app-level) Gradle file(usually
<project>/<app-module>/build.gradle.ktsor<project>/<app-module>/build.gradle),add the dependency for theApp Check library for Android. We recommend using theFirebase Android BoMto control library versioning.Kotlin
dependencies{// Import theBoM for the Firebase platformimplementation(platform("com.google.firebase:firebase-bom:34.7.0"))// Add the dependency for theApp Check library// When using theBoM, you don't specify versions in Firebase library dependenciesimplementation("com.google.firebase:firebase-appcheck-debug")}
By using theFirebase Android BoM, your app will always use compatible versions of Firebase Android libraries.
(Alternative) Add Firebase library dependencies without using theBoM
If you choose not to use theFirebase BoM, you must specify each Firebase library version in its dependency line.
Note that if you usemultiple Firebase libraries in your app, we strongly recommend using theBoM to manage library versions, which ensures that all versions are compatible.
dependencies{// Add the dependency for theApp Check library// When NOT using theBoM, you must specify versions in Firebase library dependenciesimplementation("com.google.firebase:firebase-appcheck-debug:19.0.1")}
Java
dependencies{// Import theBoM for the Firebase platformimplementation(platform("com.google.firebase:firebase-bom:34.7.0"))// Add the dependency for theApp Check library// When using theBoM, you don't specify versions in Firebase library dependenciesimplementation("com.google.firebase:firebase-appcheck-debug")}
By using theFirebase Android BoM, your app will always use compatible versions of Firebase Android libraries.
(Alternative) Add Firebase library dependencies without using theBoM
If you choose not to use theFirebase BoM, you must specify each Firebase library version in its dependency line.
Note that if you usemultiple Firebase libraries in your app, we strongly recommend using theBoM to manage library versions, which ensures that all versions are compatible.
dependencies{// Add the dependency for theApp Check library// When NOT using theBoM, you must specify versions in Firebase library dependenciesimplementation("com.google.firebase:firebase-appcheck-debug:19.0.1")}
Add the following to the configuration of your CI build variant:
testInstrumentationRunnerArguments["firebaseAppCheckDebugSecret"]=System.getenv("APP_CHECK_DEBUG_TOKEN_FROM_CI")?:""In your test classes, use the
DebugAppCheckTestHelperto wrap any codethat needs anApp Check token:Kotlin
@RunWith(AndroidJunit4::class)classMyTests{privatevaldebugAppCheckTestHelper=DebugAppCheckTestHelper.fromInstrumentationArgs()@TestfuntestWithDefaultApp(){debugAppCheckTestHelper.withDebugProvider{// Test code that requires a debug AppCheckToken.}}@TestfuntestWithNonDefaultApp(){debugAppCheckTestHelper.withDebugProvider(FirebaseApp.getInstance("nonDefaultApp")){// Test code that requires a debug AppCheckToken.}}}Java
@RunWith(AndroidJunit4.class)publicclassYourTests{privatefinalDebugAppCheckTestHelperdebugAppCheckTestHelper=DebugAppCheckTestHelper.fromInstrumentationArgs();@TestpublicvoidtestWithDefaultApp(){debugAppCheckTestHelper.withDebugProvider(()->{// Test code that requires a debug AppCheckToken.});}@TestpublicvoidtestWithNonDefaultApp(){debugAppCheckTestHelper.withDebugProvider(FirebaseApp.getInstance("nonDefaultApp"),()->{// Test code that requires a debug AppCheckToken.});}}
When your app runs in a CI environment, Firebase backend services will acceptthe token it sends as valid.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-12-17 UTC.