Couldn't start project on Android: could not connect to TCP port 5580: cannot connect to 127.0.0.1:5580:

Please provide the following:

  1. SDK Version: 39
  2. Platforms(Android/iOS/web/all): ANDOID

I am trying to connect expo with my phone via USB debugging (enabled), but here is the error, i have tried everything , no any progress, please help!!!


Couldn’t start project on Android: could not connect to TCP port 5580: cannot connect to 127.0.0.1:5580:

Hello Adam, i have a big problem , please help me!

Couldn’t start project on Android: could not connect to TCP port 5580: cannot connect to 127.0.0.1:5580:

Help: Expo SDK

Hi. I’m not sure if this will fix it, but maybe try killing expo start and then deleting the .expo directory before running expo start -c

I’m also running into this similar issue.

After I run expo start and click on Run on Android device/emulator I get this error:

Couldn't start project on Android: could not connect to TCP port 5562: Connection refused

adb devices gives me:

List of devices attached
emulator-5554	device
emulator-5562	offline

running telnet 127.0.0.1 5562 returns:

Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused
telnet: Unable to connect to remote host

I have tried restarting the adb server, and also turning off my firewall, but I get the same result. Wondering if it has to do with emulator-5562 showing as offline. I have tried removing all virtual devices from AVD Manager and re-adding, and have noticed that that emulator-5562 still persisted through the purge.

I also tried deleting .expo and running expo start -c, but same result.

Any ideas on what’s going on and how to address this?


I’m running:

Expo CLI 3.28.5
Android Studio 4.1.1
macOS 10.15.7
Android Emulator: Pixel 4 API 30

in your terminal press shift+a and try selecting the other emulator. also, you can try rebooting oyur computer as maybe one of the emulators is in a bad state. also possibly related https://stackoverflow.com/questions/54953134/prevent-android-emulator-from-starting

1 Like

@notbrent That link was super helpful. Thank you!

The solution (from link):

$ adb devices -l
List of devices attached
emulator-5562          offline transport_id:1

$ lsof | grep 5563
NTKDaemon  389  tim   19u     IPv4 0x8d889cdf67e44dd9        0t0     TCP localhost:5563 (LISTEN)
NTKDaemon  389  tim   26u     IPv4 0x8d889cdf75b8f3d9        0t0     TCP localhost:5563->localhost:49306 (ESTABLISHED)
adb       1074  tim    7u     IPv4 0x8d889cdf75b8d759        0t0     TCP localhost:49306->localhost:5563 (ESTABLISHED)

$ kill -9 389
$ adb devices -l
List of devices attached

And the expo server logs, after doing above:

Downloading the Expo client app [================================================================] 100% 0.0s
Installing Expo client on device
Opening exp://xx.xx.xxx.xx:19000 on Pixel_4_API_30
2 Likes

In case this helps anyone, the following would be slightly more reliable (and faster) than lsof | grep 5563:

lsof -i :5563 -n -P
1 Like