Created
September 12, 2018 04:38
-
-
Save bansalayush/fa6f28235438592d713ce600fe49c305 to your computer and use it in GitHub Desktop.
Install and debug react-native init app without USB!!!!!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Thank you it's awesome
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)
Thanks
And if I have many devices ?
pretty cool
Pretty Cool!
thank you, this is the only thing that works for me!
You can still avoid connecting the USB once by creating a debug apk:
cd android/
./gradlew assembleDebug
Then use the apk generated on android/app/build/outputs/apk/debug
and follow the last step.
great
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Great