1

WiFi経由でAndroidに接続する方法を見つけようとしていました..StackOverflowでいくつか見つけましたが、Androidに接続するたびにcmdに行く必要がありました..だから私はバットファイルを思いつきました

下記参照

4

1 に答える 1

4

Stackoverflow で WiFi 経由でデバイスに接続するいくつかの良い方法を見つけました..しかし、接続するたびに cmd に行く必要があり、これは私にとって不便でした..

だから私はしばらく時間をかけて、ワンクリックでAndroidをWiFI経由でadbに接続できるbatファイルを作成しました

defaultIp と adbLoc をデバイスの IP に設定し、adbLoc を adb の場所 (sdk\platform-tools) に設定するだけです。

TO USE THIS YOU MUST INITIALLY HAVE YOUR ANDROID CONNECTED VIA USB

まあ、私はしなければならなかった...

ノート

TCP/IP を使用して接続するには、最初に Android を USB 経由で接続する必要があります テストが完了し、ルート化されていない Galaxy Tab 2 10.1 もポート 5555 のファイアウォールに例外を追加しました

宣言:

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" %=%

バットがひどい場合は申し訳ありませんが、私の最初の 1 つ

于 2013-05-29T09:45:24.600 に答える