Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Flutter and app store releases

Expo cannot reach the Android emulator on port 5554

Errorcould not connect to TCP port 5554: cannot connect to 127.0.0.1:5554

Short answer

Port 5554 is the emulator's console port, with adb on 5555. Expo cannot connect when no emulator is running there, when adb does not list it, or when two different adb versions fight over the server. Start the emulator first, check adb devices, then restart the adb server.

  • Applies to Expo SDK 5x, Android Emulator 35+, Android SDK Platform Tools
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Ask adb what it can see. An emulator that is up shows as emulator-5554 with the state device.

    adb devices
    emulator -list-avds
  2. 2Match what you see, then jump to its fix

    1. 1adb devices lists nothingThe emulator is not runningFix
    2. 2The emulator window is open, but adb devices is empty or shows it as offlineadb does not show the emulator, or its server is staleFix
    3. 3adb: command not found, or adb server version (xx) doesn't match this client (xx); killing...adb is not on your PATH, or two adb versions are installedFix

What does the error look like?

  • could not connect to TCP port 5554: cannot connect to 127.0.0.1:5554

Cause 1 of 3

The emulator is not running

1Check

The first emulator on a machine takes console port 5554 and adb port 5555. If no emulator is started, nothing listens there.

adb devices

2Fix

Start an emulator from the Device Manager in Android Studio, or from the terminal with one of the names from the list, and wait until it has fully booted. Then run Expo.

emulator -avd Pixel8_API_34
npx expo start --android

3Verify

adb lists the emulator with the state device.

adb devices

Confirmed by developer.android.com

Did this fix it?

Cause 2 of 3

adb does not show the emulator, or its server is stale

1Check

The adb server may have started after the emulator, or an old server is still running. If you started the emulator with an odd -port value between 5554 and 5584, it can also stay invisible to adb.

adb devices -l
ps aux | grep "[e]mulator"

2Fix

Stop the adb server and start it again. If you pass -port, use an even number.

adb kill-server
adb start-server
adb devices

3Verify

The emulator now appears as emulator-5554 with state device.

adb devices

Confirmed by developer.android.com

Did this fix it?

Cause 3 of 3

adb is not on your PATH, or two adb versions are installed

1Check

Expo needs adb in your terminal. Set ANDROID_HOME and add platform-tools and emulator to PATH. If the version message appears, you have more than one adb install.

echo $ANDROID_HOME
which -a adb
adb version

2Fix

Add the SDK folders to your shell profile and reload it, then use the adb from the SDK's platform-tools folder.

export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/platform-tools

3Verify

adb version prints once, from the SDK folder.

which adb && adb version

Confirmed by docs.expo.dev

Did this fix it?

How do I stop it coming back?

  • Start the emulator and wait for the home screen before you run npx expo start.
  • Keep one adb install, the one in the Android SDK platform-tools folder.
  • Run adb kill-server when you switch between several emulators or physical devices.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Mobile apps

Android Studio cannot pair the phone over Wi-Fi

The Pair devices over Wi-Fi dialog lists no device

Wireless pairing needs the phone on Android 11 or higher and on the same Wi-Fi network as the computer, with current Platform-Tools.

4 causes, each with a fix

Mobile apps

adb tcpip 5555 fails because no device is found

adb: more than one device/emulator

adb tcpip only works while the device is attached and listed by adb, because it tells the phone to start listening on port 5555.

4 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.