Reputation: 107
Hello I'm new to react native. and i'm trying to debug the code with real device. But every time I'm debug I'm getting an error :
unable to connect with remote debugger Failed to connect to localhost/127.0.0.1:8081
this on my mobile screen. Any help will be appreciated.
Upvotes: 0
Views: 589
Reputation: 318
shake your device and in the menu choose dev settings in debug server host & port for device section enter your pc ip address via port 8081 like this :
192.168.1.3:8081
Upvotes: 0
Reputation: 2404
There could be several cases where you can't connect to debugger:
In some cases on real devices, you might need to run adbe reverse command:
adb reverse tcp:8081 tcp:8081
Uninstall the app, stop the packager, and restart the packager with reset cache option:
npm start -- --reset-cache
And then, run it on device again.
Upvotes: 0