Forked from bansalayush/gist:fa6f28235438592d713ce600fe49c305
Created
September 20, 2022 21:24
-
-
Save mehmetsalihyaldiz/932f0462507112f2e85861d84997d769 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment