I just bundled my React Native project and ran it on my emulator. The problem is after every small change I make I have to bundle it again and then run it. And when I do this after the project run is complete the emulator disconnects from the developer server and I get the error: Could not connect to development server.
Asked
Active
Viewed 1,479 times
2 Answers
1
You do not need to bundle the package server when you run the project using an emulator. You just need to go dev settings by pressing CTRL+M and give your local IP address with the port (Ex: 192.168.43.188:8081)
Dev settings -> Debug server host & port for device -> your ip address:8081

J.plus.123
- 107
- 4
-
So I should always be connected to a network?? I used to run it without setting this IP thing! – Sepehr Nematollahi Jul 12 '18 at 11:36
-
This one uses while we are developing the application. If you made any changes you can check it real time for using this way. If you need an APK file for testing you need to bundle the package server and create App-debug.apk file. What is the command did you use for bundle the debug build? – J.plus.123 Jul 12 '18 at 15:46
0
Check out this thread here, seems similar: How to enable live reload in react native on android?
In your command prompt, install and launch your app on the device or emulator:
$ react-native run-android
Then click on emulator and press CTRL + M, then select the Enable Live Reload
option.

DTD
- 116
- 5
-
Thanks but the problem is reloading itself! Not live reload. – Sepehr Nematollahi Jul 11 '18 at 18:13