@echo off
echo killing adb server
start /wait adb.exe kill-server
echo starting adb server
start /wait adb.exe start-server
echo getting device ip
adb.exe shell ifconfig wlan0
set /p __i=What is the 'inet addr':
echo making adb go remote
start /wait adb.exe tcpip 7999
echo Please unplug the device.
timeout /t 10
echo connecting to device
start /wait adb.exe connect %__i%:7999
echo done
timeout /t 1 /nobreak>nul