When debugging a ReactNative app on a physical Android device, one can get an error that the device cannot connect to Metro.
Usually, the error is related to the port forwarding not being set up (the laptop port 8081 should be exposed to the device port 8081).
When you have more than 1 device connected (like one emulator and one physical device), the port reversing will not work and will give you the more than one device/emulator
error.
In this case, you need to:
- Run the
adb devices
command to list all the connected devices
Example output:
List of devices attached
760023010483 device
emulator-5554 device - Do the reverse command for the specific device you want to run your app on
adb -s 760023010483 reverse tcp:8081 tcp:8081