Reputation: 6972
React native stopped working, whenever I run it now (no matter which project) I get the error could not connect to development server | ensure the following node server is running and available on the same network - run npm start from react native root.
Node server url is correctly set in appdelegate
URL : http://localhost:8081/index.ios.bundle? platform=ios&dev=false
Upvotes: 3
Views: 10058
Reputation: 5095
I was face same problem while running in physical device.
I did as below:
note: cross check in browser ip along with port number.
Upvotes: 1
Reputation: 164
Please ensure you have done the following
1) run server using
npm start
2) if you are using actual device , make sure you are connected to same network
3) for android: run the following command and try again
adb reverse tcp:8081 tcp:8081
Upvotes: 2
Reputation: 1814
To debug on a real device:
On iOS - open the file AppDelegate.m and change localhost to the IP address of your computer. Shake the device to open the development menu with the option to start debugging.
let jsCodeLocation = NSURL(string: "http://{{YOUR IP ADRESS}}:8081/index.bundle?platform=ios")
Upvotes: 0
Reputation: 33
I usually just run npm start in my terminal. (OSX) I assume it would be the same on Windows
npm start
Upvotes: 0