After App Check is enforced for a backend service, your app's features that depend on that backend service won't run in an emulator or from a continuous integration (CI) environment because these environments don't qualify as valid devices. To run your app in these environments during development and testing, you need to create a debug build of your app that uses the App Check debug provider instead of a production attestation provider.
Apple platforms
Here's how to use the debug provider while running your app in a simulator interactively (for example, during local development):
Activate App Check with the debug provider right after you've initialized your Firebase app:
import 'package:flutter/material.dart'; import 'package:firebase_core/firebase_core.dart'; // Import the firebase_app_check plugin import 'package:firebase_app_check/firebase_app_check.dart'; Future<void> main() async { WidgetsFlutterBinding.ensureInitialized(); await Firebase.initializeApp(); await FirebaseAppCheck.instance.activate( // Set appleProvider to `AppleProvider.debug` appleProvider: AppleProvider.debug, ); runApp(App()); }Enable debug logging in your Xcode project (v11.0 or newer):
- Open Product > Scheme > Edit scheme.
- Select Run from the left menu, then select the Arguments tab.
- In the Arguments Passed on Launch section, add
-FIRDebugEnabled.
Obtain your debug token:
Open
ios/Runner.xcworkspacewith Xcode and run your app in the simulator or on your test device.Open the Xcode console and look for the App Check debug token. For example:
<Warning> [AppCheckCore][I-GAC004001] App Check debug token: '123a4567-b89c-12d3-e456-789012345678'.Copy the token (for example,
123a4567-b89c-12d3-e456-789012345678).
Register your debug token with App Check:
In the Firebase console, go to the Security > App Check > Apps tab.
Find your app, click the three-dot overflow menu (), and then select Manage debug tokens.
Follow the on-screen instructions to register your debug token.

After you register the token with App Check, your backend services will accept it as valid.
This token allows access to your backend services without a valid device, so it's crucial that you keep it private. Do not commit it to a public repository or ship it in production builds of your app. If a registered token is ever compromised, delete it immediately using Manage debug tokens in the Firebase console.
Android
Here's how to use the debug provider while running your app in an emulator interactively (for example, during local development):
Activate App Check with the debug provider right after you've initialized your Firebase app:
import 'package:flutter/material.dart'; import 'package:firebase_core/firebase_core.dart'; // Import the firebase_app_check plugin import 'package:firebase_app_check/firebase_app_check.dart'; Future<void> main() async { WidgetsFlutterBinding.ensureInitialized(); await Firebase.initializeApp(); await FirebaseAppCheck.instance.activate( // Set androidProvider to `AndroidProvider.debug` androidProvider: AndroidProvider.debug, ); runApp(App()); }Obtain your debug token:
Run your app in the emulator or on your test device.
Look for the App Check debug token in your logs. For example:
D DebugAppCheckProvider: Enter this debug secret into the allow list in the Firebase Console for your project: 123a4567-b89c-12d3-e456-789012345678Copy the token (for example,
123a4567-b89c-12d3-e456-789012345678).
Register your debug token with App Check:
In the Firebase console, go to the Security > App Check > Apps tab.
Find your app, click the three-dot overflow menu (), and then select Manage debug tokens.
Follow the on-screen instructions to register your debug token.

After you register the token with App Check, your backend services will accept it as valid.
This token allows access to your backend services without a valid device, so it's crucial that you keep it private. Do not commit it to a public repository or ship it in production builds of your app. If a registered token is ever compromised, delete it immediately using Manage debug tokens in the Firebase console.
Web
Here's how to use the debug provider while running your app from localhost
(for example, during local development):
In the file
web/index.html, enable debug mode by settingself.FIREBASE_APPCHECK_DEBUG_TOKENtotrue:<body> <script> self.FIREBASE_APPCHECK_DEBUG_TOKEN = true; </script> ... </body>Run your web app locally and open the browser's developer tools. In the debug console, you'll see a debug token. For example:
AppCheck debug token: "123a4567-b89c-12d3-e456-789012345678". You will need to safelist it in the Firebase console for it to work.This token is stored locally in your browser and will be used whenever you use your app in the same browser on the same machine. If you want to use the token in another browser or on another machine, set
self.FIREBASE_APPCHECK_DEBUG_TOKENto the token string instead oftrue.Register your debug token with App Check:
In the Firebase console, go to the Security > App Check > Apps tab.
Find your app, click the three-dot overflow menu (), and then select Manage debug tokens.
Follow the on-screen instructions to register your debug token.

After you register the token with App Check, your backend services will accept it as valid.
This token allows access to your backend services without a valid device, so it's crucial that you keep it private. Do not commit it to a public repository or ship it in production builds of your app. If a registered token is ever compromised, delete it immediately using Manage debug tokens in the Firebase console.