Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Install and debug react-native init app without USB!!!!!
1) Connect your mobile device via usb (just this once)
2) Establish a port with your mobile device using 'adb tcpip <port number>'.
eg. adb tcpip 5555
3) Remove USB and 'adb connect <mobile device ip><above mentioned port number>' .
Eg . adb connect 192.160.0.124:5555
4) 'React-native run-android' in your project folder
Once the app is installed it might show a red screen . Though we have established a connection between our mobile and laptop ,
our react-native app still listens to localhost:8081 to get the javascript bundle
5) There’s a solution for this too :) .
Open your dev menu (shake your device) ->
Dev settings ->
Under Debugging ->
Debug server host & …….. ->
pop up ->
enter your laptop’s ip and port or just follow this https://facebook.github.io/react-native/docs/running-on-device#method-2-connect-via-wi-fi :P
Now if you have any sentiments attached to using your USB cable and wanna reverse the above process just 'adb usb' to switch back to normal useage
@chakrihacker

This comment has been minimized.

Copy link

@chakrihacker chakrihacker commented Sep 25, 2018

Cool

@lucaspiressimao

This comment has been minimized.

Copy link

@lucaspiressimao lucaspiressimao commented Apr 20, 2019

nice

@Mubeyd

This comment has been minimized.

Copy link

@Mubeyd Mubeyd commented Nov 1, 2019

Cool

@BravoNatalie

This comment has been minimized.

Copy link

@BravoNatalie BravoNatalie commented Nov 12, 2019

Great

@rynvva

This comment has been minimized.

Copy link

@rynvva rynvva commented Nov 24, 2019

Thank you it's awesome

@Chaosology-Asartheen

This comment has been minimized.

Copy link

@Chaosology-Asartheen Chaosology-Asartheen commented Jan 4, 2020

I need to connect my ios device like this...

But I didn't have any mac system.. It is possible to connect windows OS to iPhone (install and debug with or without cable)

@luolin2611

This comment has been minimized.

Copy link

@luolin2611 luolin2611 commented Mar 23, 2020

Thanks

@hadpro24

This comment has been minimized.

Copy link

@hadpro24 hadpro24 commented May 22, 2020

And if I have many devices ?

@chrispop

This comment has been minimized.

Copy link

@chrispop chrispop commented Jul 26, 2020

pretty cool

@sanjeev1379

This comment has been minimized.

Copy link

@sanjeev1379 sanjeev1379 commented Sep 7, 2020

Pretty Cool!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.