Is anyone else having trouble connecting to the firebase emulators from real devices?

I’ve setup firebase emulators for the realtime db and firestore on my local machine (i’ll refer to it as host from now. it’s a Mac)
when i run the ios simulator the database connections are localhost:5002/3 which works fine and connects correctly to the emulators.
but when i run on a real device using the expo app, after replacing localhost in the db connection strings to the ip of my host machine (192.168…), i cannot connect to the emulators.
i’ve tried the following prefixes:
http://
https://
exp://
no prefixes at all

does anyone know how i can connect from a device running the expo app to firebase db emulators??

2 Likes

I figured this issue out. it is not with Expo. need to add 0.0.0.0 as the host ip address for each emulator. like so

"emulators": {
		"functions": {
			"port": "5001",
			"predeploy": "npm --prefix functions run build",
			"host": "0.0.0.0"
		},
		"firestore": {
			"port": "5002",
			"host": "0.0.0.0"
		},
		"database": {
			"port": "5003",
			"host": "0.0.0.0"
		},
		"ui": {
			"enabled": true
		}
	},
2 Likes