Before connecting your app to the Cloud Functions emulator, make sure that you understand the overall Firebase Local Emulator Suite workflow and that you install and configure the Local Emulator Suite.
Instrument your app to talk to the emulators
If your prototype and test activities involve callable backend functions, configure interaction with the Cloud Functions for Firebase emulator like this:
// 10.0.2.2 is the special IP address to connect to the 'localhost' of // the host computer from an Android emulator. FirebaseFunctions functions = FirebaseFunctions.getInstance(); functions.useEmulator("10.0.2.2.", 5001);
iOS - Swift
Each HTTPS function in your code will be served from the local emulator using the following URL format:
For example a simple
helloWorld function with the default host port and region would be served at:
Background Triggered Functions
The Cloud Functions emulator supports background-triggered functions from the following sources:
- Realtime Database emulator
- Cloud Firestore emulator
- Cloud Pub/Sub emulator
To trigger background events, connect your app or test code to the emulators using the SDK for your platform.