If, after you have registered your app for App Check , you want to run your app in an environment that App Check would normally not classify as valid, such as a simulator or device during development, or from a continuous integration (CI) environment, you can create a debug build of your app that uses the App Check debug provider instead of a real attestation provider.
Use the debug provider in development
To use the debug provider while running your app interactively (during development, for example), do the following:
-
In your debug build, before using any Firebase backend services, create and set the App Check debug provider factory:
Swift
let providerFactory = AppCheckDebugProviderFactory () AppCheck . setAppCheckProviderFactory ( providerFactory ) FirebaseApp . configure ()
Objective-C
FIRAppCheckDebugProviderFactory * providerFactory = [[ FIRAppCheckDebugProviderFactory alloc ] init ]; [ FIRAppCheck setAppCheckProviderFactory : providerFactory ]; // Use Firebase library to configure APIs [ FIRApp configure ];
-
Enable debug logging in your Xcode project (v11.0 or newer):
- Open Product > Scheme > Edit scheme.
- Select Runfrom the left menu, then select the Argumentstab.
- In the Arguments Passed on Launchsection, add
-FIRDebugEnabled.
-
Launch the app. A local debug token will be logged when the SDK tries to send a request to the backend. For example:
[Firebase/AppCheck][I-FAA001001] Firebase App Check Debug Token: 123a4567-b89c-12d3-e456-789012345678
-
In the Firebase console, navigate to Security> App Check .
-
Register your debug token that you just logged.
- In the Appstab, find your app.
- From your app's overflow menu, select Manage debug tokens.
- Follow the on-screen instructions to register your debug token.

After you register the token, Firebase backend services will accept it as valid.
Because this token allows access to your Firebase resources without a valid device, it is crucial that you keep it private. Don't commit it to a public repository, and if a registered token is ever compromised, revoke it immediately in the Firebase console.
Use the debug provider in a CI environment
To use the debug provider in a continuous integration (CI) environment, do the following:
-
In the Firebase console, navigate to Security> App Check .
-
Create a debug token. You'll need this token in the next step.
- In the Appstab, find your app.
- From your app's overflow menu, select Manage debug tokens.
- Follow the on-screen instructions to create a new debug token.
Because this token allows access to your Firebase resources without a valid device, it is crucial that you keep it private. Don't commit it to a public repository, and if a registered token is ever compromised, revoke it immediately in the Firebase 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's encrypted variables ).
-
If necessary, configure your CI system to make your debug token available within the CI environment as an environment variable. Name the variable something like
APP_CHECK_DEBUG_TOKEN_FROM_CI. -
In Xcode, add an environment variable to your testing scheme with the name
FIRAAppCheckDebugTokenand something like$(APP_CHECK_DEBUG_TOKEN)as the value. -
Configure your CI test script to pass the debug token as an environment variable. For example:
xcodebuild test -scheme YourTestScheme -workspace YourProject .xcworkspace \ APP_CHECK_DEBUG_TOKEN=$(APP_CHECK_DEBUG_TOKEN_FROM_CI)
-
In your debug build, before using any Firebase backend services, create and set the App Check debug provider factory:
Swift
let providerFactory = AppCheckDebugProviderFactory () AppCheck . setAppCheckProviderFactory ( providerFactory ) FirebaseApp . configure ()
Objective-C
FIRAppCheckDebugProviderFactory * providerFactory = [[ FIRAppCheckDebugProviderFactory alloc ] init ]; [ FIRAppCheck setAppCheckProviderFactory : providerFactory ]; // Use Firebase library to configure APIs [ FIRApp configure ];
When your app runs in a CI environment, Firebase backend services will accept the token it sends as valid.

