0
我試圖找到一種方法,通過WiFi連接到我的android ..發現了一些StackOverflow,但他們都需要去cmd每次我想連我的Android ..所以我想出了一個bat文件如何通過WiFi連接到adb *使用方便的BAT文件*
見下
我試圖找到一種方法,通過WiFi連接到我的android ..發現了一些StackOverflow,但他們都需要去cmd每次我想連我的Android ..所以我想出了一個bat文件如何通過WiFi連接到adb *使用方便的BAT文件*
見下
我發現了一些不錯的方式通過#2的WiFi連接到您的設備。但它們都需要去到CMD每次你需要時間連接,這對我來說很不方便..
所以我花了一些時間,並創建一個bat文件,只需點擊一下就可以連接你[R通過WiFi
Android版ADB所有你需要做的是設置defaultIp和adbLoc的設備和adbLoc你亞行的位置的IP(SDK \平臺工具)
TO USE THIS YOU MUST INITIALLY HAVE YOUR ANDROID CONNECTED VIA USB
以及我不得不...
您的Android必須連接通過USB最初使用TCP/IP 我的測試是爲了連接和Galaxy Tab的2 10.1非植根 我還添加了一個例外,我的防火牆港口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 set this to true, else set to false
的實際.bat文件(它保存爲startAdbWifi.bat過的位置,像桌面)如果蝙蝠是可怕
@echo off
:: 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
@echo 01010101010101010101010101 CONFIG 01010101010101010101010101
@echo Is This your first time using this bat?
@echo make sure that you have configured:
@echo defaultIp: %defaultIp%
@echo adbLoc: %adbLoc%
@echo askForIP: %askForIP%
@echo change "enableSetVariablesWarning" to anything other than
@echo true to disable this warning
@echo 01010101010101010101010101 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" %=%
對不起,我的第一
一個
我有問題,我試圖重新連接它,因爲我休息了adb過程,並失敗..我已經添加了「adb tcpip 5555」到蝙蝠,並已修復它太遠了 –