How to run React Native app on Android Phone
If you are connected via cable, do the following:
1. Goto > Settings > About Device
2. Then Software Info
3. Then > Build Number
4. Now Tap (Click) multiple times on Build Number to Enable Developer Options
5. Here you go not the Developer Options will be visible in your Settings
6. Now Go inside the Developer Options and Enable USB Debugging Mode.
7. Open your terminal
On Windows open Android SDK Manger > Platform Tools
Type:
$ adb devices
This will show you the devices and simulator/virtual-devices that you have on you computer.
8. Forward requests from your device
Type:
$ adb reverse tcp:8081 tcp:8081
9. Run it
Type:
$ npm run android
The app should appear on your device
Looks like the source code in your APK is looking for the package server.
Read this on how to build APKs for react-native: React-Native - Generating Signed APK
If your devices is connected via cable:
- If you're on a physical device connected to the same machine, run 'adb reverse tcp:8081 tcp:8081' to forward requests from your device
Otherwise, you can still do this via Wifi by following the last point in the error:
- If your device is on the same Wi-Fi network, set 'Debug server host & port for device' in 'Dev settings' to your machine's IP address and the port of the local dev server -e.g. 10.0.1.1:8081