How To Connect To Adb Via Wifi *with A Convenient Bat File*
Solution 1:
I Found some nice ways to connect to your device via WiFi on Stackoverflow.. But they all required going to cmd every time you wanted to connect and this was inconvenient for me..
So I spent some time and created a bat file which with one click allows you to connect your android to adb via WiFI
All you need to do is set defaultIp AND adbLoc to the IP of the device and adbLoc to the location of your adb (sdk\platform-tools)
TO USE THIS YOU MUST INITIALLY HAVE YOUR ANDROID CONNECTED VIA USB
well I had to...
NOTE
Your android must be connected Via USB initially to connect using TCP/IP My test was done and a Galaxy Tab 2 10.1 non rooted I also added an exception to my firewall for port 5555
Declatations:
defaultIp == the IP of your android
adbLoc == where the adb.exe is located for the sdk
enableSetVariablesWarning == Show the initial warning?
askForIP == If your android has a dynamic ip you might have
... to setthis to true, elseset to false
The Actual Bat file (save this as startAdbWifi.bat where ever, like desktop)
@echooff
:: This is one of my First bat's so sorry if it's terrible
:: Initilisation of Variables.. Put your defualts in here
:: Change enableSetVariablesWarning to anything else to
:: disable warning
set defaultIp="SET ME"
set adbLoc="SET ME"
set enableSetVariablesWarning="true"
set askForIP="true"
:: End of Initiation
if /I %enableSetVariablesWarning%=="true" GOTO COMMENT
GOTO ENDOFCOMMENTS
:COMMENT
@echo01010101010101010101010101 CONFIG 01010101010101010101010101@echo Is This your first time using this bat?
@echo make sure that you have configured:
@echodefaultIp: %defaultIp%
@echoadbLoc: %adbLoc%
@echoaskForIP: %askForIP%
@echo change "enableSetVariablesWarning" to anything other than
@echo true to disable this warning
@echo01010101010101010101010101 CONFIG 01010101010101010101010101@echo.
:ENDOFCOMMENTS
@echo Make sure that the Android is connected
if /I %askForIP%=="true" GOTO GETIP
set ip=%defaultIp%
GOTO CONNECT
:GETIP
set ip="invalid"
set /p ip="Enter IP(default=192.168.1.75): " %=%
if /I %ip%=="invalid" GOTO SETIP
GOTO CONNECT
:SETIP
set ip=%defaultIp%
@echo Defaulting the ip to: %ip%
:CONNECT
set curr_dir=%cd%
chdir /D %adbLoc%
@echo Restarting adb
adb kill-server
adb tcpip 5555
adb connect %ip%
adb devices
chdir /D %curr_dir%
set /p ip="Press Enter to Exit" %=%
Sorry if the bat is terrible, one of my first
Post a Comment for "How To Connect To Adb Via Wifi *with A Convenient Bat File*"