I found the solution suggested in the thread at https://github.com/facebook/react-native/issues/15388
To install the application on the phone, manually configure the host and port of the debug server.
Step by step to extract and run CRNA on Android
In terminal:
create-react-native-app myAppcd myAppyarn run eject (I used the default option "regular React Native project")react-native run-android
(Now the application must be compiled and installed on the phone)
On the phone:
- Launch the application (expect to see a red error screen - click the "Reject" button in the lower left)
- Shake your phone and select Dev Settings
- Select the host and port of the debug server for the device and set the value to 192.168.xx: 8081 (make it your actual LAN interface).
- Restart the application on the phone and you will see a green bar at the top "Download from 192.168.xx: 8081 ..."
- You should also see the "
index.js " action in the Metro Bundler (open when react-native run-android starts) - After the package is completed, the application must be running on your Android device!
Live Reload (when changing source files) also works - just shake your phone and click on โEnable Live Reloadโ
You can start the project from Android Studio, but first you need to run the Metro Bundler with the react-native start command in the root of the CRNA project.
source share