How to choose on which device I run with Expo

I’m developing an app using a Chromebook, and I theoretically, I can run Android apps locally. Unfortunately when I try and do this in Expo CLI, I get the message Couldn't start project on Android: could not connect to TCP port 5554: Connection refused. I have no idea how to get it to stop refusing the connection, so if anyone has a suggestion, that would be great.

However, assuming I can’t get that to work, I’ve also plugged my Android phone in via USB with ADB debugging enabled. I would like to try and run an Expo app on that instead, but when I use the CLI, it seems to only try to run it on port 5554, i.e. it is ignoring my phone. Is there a way to specify to Expo CLI on which Android device it should run? Because I can’t turn off the Chromebook’s ADB debugging without wiping the whole computer :S

you can press shift+a to pick which device to run on if you have multiple devices connected. the same applies for ios if you press shift+i.

Ah yes, I must have missed that one, thanks. Unfortunately, it’s not working for me. I still get the same error message above: Couldn't start project on Android: could not connect to TCP port 5554: Connection refused

In ADB I see two devices, but even with shift-a, Expo seems to ignore the second one. My ADB looks like this:

violentfemme@penguin:~$ adb devices
List of devices attached
emulator-5554   device
D0AA002368JA2302063     device

The really strange part is now Expo can’t even create a tunnel for Expo Go, it gives a very similar error: Error starting tunnel could not connect to TCP port 5554: Connection refused

I don’t know why suddenly Expo wants to do everything on port 5554. It’s really giving me a headache because at this point, absolutely nothing is working any more.

expo doesn’t actually itself have any say on this port - this is all adb. you can try looking to see what others users did when encountering this error if you haven’t already, eg: react native - Expo Couldn't start project on Android: could not connect to TCP port 5554: Connection refused - Stack Overflow

Thanks for finding the link. I did already do a lot of Googling and I’ve seen that, though frankly I didn’t really understand it. But I’ll take another look.

Do you have any idea why it’s trying to create a tunnel on port 5554? Is that to do with ADB?

If I could just go back to running the app through Expo Go, that would be ok. I can’t currently run the app at all. I need the tunnel because I never got it working over LAN. This networking stuff is just beyond me.

Unfortunately, if I want to disable ADB on my Chromebook, I have to hard wipe the whole machine and set up my development environment all over again. I’m on the verge of doing it anyway, but if you can help so I don’t have to, it would mean a lot to me! Thanks.

Never mind, I’m gonna do it and wipe my computer. It’s really not that big a deal with a Chromebook. Just want to be able to work on my game again!

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.