Skip to content

Instantly share code, notes, and snippets.

@GEMISIS
Created April 12, 2020 03:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GEMISIS/741a784928eefe4c9da17c7242c0ed39 to your computer and use it in GitHub Desktop.
Save GEMISIS/741a784928eefe4c9da17c7242c0ed39 to your computer and use it in GitHub Desktop.
Setup an Android devices to be usable over a wireless connection instead.
@echo off
for /F "tokens=* USEBACKQ" %%F in (`adb shell getprop ro.product.model`) do (
set device_name=%%F
)
for /F "tokens=9 USEBACKQ" %%F in (`adb shell ip route`) do (
set ip_addr=%%F
)
echo Setting up wireless debugging for %device_name% at %ip_addr%...
adb tcpip 5555
adb connect %ip_addr%:5555
sleep 1
for /F "tokens=* USEBACKQ" %%F in (`adb devices`) do (
set device_list=%%F
)
echo Success! Here is the list of connected devices:
echo.
echo %device_list%
echo.
echo You may now disconnect your device!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment