Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Re-connect to metro server after disconnect

Tags:

react-native

I am running react-native run-android with physical android device plug in with usb port.

However, when the cable is disconnected. I can't reconnect back to metro server automatically.

I have to rerun react-native run-android which was quite a waste of time.

Is there any command that can use to reconnect?

like image 410
vincentsty Avatar asked Jan 13 '20 02:01

vincentsty


2 Answers

try in terminal adb reverse tcp:8081 tcp:8081 and after that in the Metro Bundler Window hit r key

like image 175
Javi Avatar answered Nov 19 '22 22:11

Javi


Check that the device is reconnected to the machine with:

adb devices

Reroute the connection to the development server with:

adb reverse tcp:8081 tcp:8081
like image 10
Azam Avatar answered Nov 19 '22 21:11

Azam