React Native Packager and the Android Emulator uses port 8081 by default. To use a different port (let's say 8082):
1. Add
"--port=8082" to the
react-native start command, like this:
react-native start --port=8082
2. With your application open in the Android Emulator (and has an error because it can't read from port 8081), trigger the developer menu using the following on the command line:
adb shell input keyevent 82
3. Navigate to
Dev Settings > Debug server host & port for device, and enter your host and port, use this Stackoverflow comment as guide:
https://stackoverflow.com/questions/37900078/react-native-could-not-connect-to-development-server/38117960#38117960