Unable to connect with remote debugger
I'm using React.JS and when I do react-native run-android
(with my device plugged in) I see a blank page. When I shake the device and select Debug JS Remotely
from the option list I see the following screen.
FYI:
OS: Ubuntu 16.04
Node version is: v4.6.2
java version "1.8.0_111"
react": "15.4.1
react-native": "0.38.0
In my case the issue was that the emulator was making a request to:
http://10.0.2.2:8081/debugger-ui
instead of:
http://localhost:8081/debugger-ui
and the request was failing.
To solve the issue: Before enabling remote debugging on your emulator, open http://localhost:8081/debugger-ui
in chrome. Then enable remote debugging and go back to the chrome page where you should see your console logs.
Solved the issue following:
- Press
Cmd + M
on emulator screen - Go to
Dev settings > Debug server host & port for device
- Set
localhost:8081
- Rerun the android app:
react-native run-android
Debugger is connected now!
I solved it doing adb reverse tcp:8081 tcp:8081
and then reload
on my phone.