Skip to content

Instantly share code, notes, and snippets.

@gppam
Created April 4, 2019 19:52
Show Gist options
  • Save gppam/c653c84f21afe738e32b368fcea1e294 to your computer and use it in GitHub Desktop.
Save gppam/c653c84f21afe738e32b368fcea1e294 to your computer and use it in GitHub Desktop.
adb wifi batch script
@echo off
echo Set up wifi connect thru ADB
pause
adb tcpip 5555
echo Waiting for device to initialize
timeout 3
FOR /F "tokens=2" %%G IN ('adb shell ip addr show wlan0 ^|find "inet "') DO set ipfull=%%G
FOR /F "tokens=1 delims=/" %%G in ("%ipfull%") DO set ip=%%G
echo Connecting to device with IP %ip%...
adb connect %ip%:5555
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment