Created
October 9, 2018 10:18
-
-
Save IdrisN/80b7c281f735cbdb17c841b3f3875b2d to your computer and use it in GitHub Desktop.
Batch script to enable wireless adb with just one command
This file contains hidden or 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
| FOR /F "tokens=9 delims= " %%a in ('adb shell ip route') do ( | |
| set ip=%%a | |
| ) | |
| adb tcpip 5555 | |
| set ipwithport=%ip%:5555 | |
| adb connect %ipwithport% |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello, and thank you.
I have three questions (sorry if I'm asking about obvious things, I'm learning this on my own):
'adb shell ip route'with the following?C:\Users\MyUser\WhereMyAdbFilesAreLocated\platform-tools\Thank you for sharing your code and for any patient answers you are able to provide.
P.S.
I also stumbled upon an article you may or may not be interested in, related to the topic of your code.
Disclaimer: The article is not mine and I have no relation to its author; But I found his method to be quite comprehensive (if perhaps unnecessarily convoluted for some), and encompassing.
If you're interested (I hope I'm not braking any rules by posting an external link here):
https://copyprogramming.com/howto/batch-script-for-adb-connect-over-wifi