shabnam singh
shabnam singh

Reputation: 107

Unable to debug in device

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

Answers (2)

Mehdi Meshkatian
Mehdi Meshkatian

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

Faruk Yazici
Faruk Yazici

Reputation: 2404

There could be several cases where you can't connect to debugger:

  1. Device and host machine definitely should be on the same network. Either connect your mobile to your PC's network or your pc to the mobile hotspot.
  2. In some cases on real devices, you might need to run adbe reverse command:

    adb reverse tcp:8081 tcp:8081
    
  3. 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

Related Questions