Save the date - Google I/O returns May 18-20. Register to get the most out of the digital experience: Build your schedule, reserve space, participate in Q&As, earn Google Developer profile badges, and more. Register now

Set up the Firebase Emulators

The Firebase Emulators make it easier to fully validate your app's behavior and verify your Firebase Security Rules configurations. Use the Firebase Emulators to run and automate unit tests in a local environment.

Install the Firebase Emulators

Before you begin make sure you have installed the Firebase CLI and configured the Firebase Local Emulator Suite

Start the emulator using the following command. The emulator runs during all your tests.

Cloud Firestore

 firebase emulators:start --only firestore

Realtime Database

 firebase emulators:start --only database

Set up tests and run the emulator

Now that you've installed the emulator, set up tests and generate reports to validate your rules' behavior before you deploy them to production.


For a few basic test cases with simple rules, try out the testing quickstart.