Skip to content Skip to sidebar Skip to footer

React-native Could Not Connect To Development Server On Android Device

Device is connected, Package Server is running, there was issue of port 8081, That's why I started this using react-native run-android and react-native start --port 8089. But stil

Solution 1:

Have the same issue witch happens after every run-android . This line from https://facebook.github.io/react-native/docs/running-on-device-android.html helps , i press reload and it works but next time -same thing

adb reverse tcp:8081 tcp:8081

or

sudo adb reverse tcp:8081 tcp:8081

Solution 2:

There are two ways to connect to development server.

  1. Via wifi if your mobile and pc is in same network.
  2. Via usb cable.

For num 1 go through following checklist.

  1. Check if your machine and mobile device is connected to same wifi network.

  2. Open the react native menu in mobile device by typing this command "adb shell input keyevent 82" (your device must be connected to your machine via usb cable when using this command).

  3. Click the option that stated "dev server" or something like that.

  4. Enter your machines ip address along with the port number. In my case it is 192.168.0.10:8081

  5. Reload the application and bingo.

For number 2 you can enter this command in the terminal "adb reverse tcp:8081 tcp:8081" .That will do the rest.

Solution 3:

if you have a virtual device after you run react-native start open a new terminal and go to your app directory and type adb connect 127.0.0.1:62001 then type adb devices now you should see your device after that go to your emulator or real device and shake it(in vitual device ctrl+0) and go to dev setting and ............

Post a Comment for "React-native Could Not Connect To Development Server On Android Device"