如何连接通过WiFi亚行*拥有便利的BAT文件* [英] How To Connect to adb via WiFi *With a convenient BAT file*

查看:234
本文介绍了如何连接通过WiFi亚行*拥有便利的BAT文件*的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图找到一种方法,通过wifi连接到我的Andr​​oid ..发现了一些在计算器上,但他们都requireing要CMD每次我想连接我的Andr​​oid ..时间,所以我想出了一个bat文件

I was trying to find a way to connect Via WiFi to my android.. Found some on StackOverflow but they were all requireing going to cmd every time I wanted to connect my android.. So I came up with a bat file

请参见下面

推荐答案

我发现了一些不错的方式通过#2的WiFi连接到您的设备。但他们都需要去CMD每次你想连接的时间,这是不方便对我来说..

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..

所以我花了一些时间,创造了一个bat文件,该文件与点击,您可以将您的Andr​​oid通过WiFi亚行

So I spent some time and created a bat file which with one click allows you to connect your android to adb via WiFI

所有你需要做的是设置defaultIp和adbLoc到设备,adbLoc您亚行的位置的IP(SDK \\平台工具)

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...

您的Andr​​oid必须连接通过USB最初使用TCP / IP连接
我的测试做和的Galaxy Tab 2 10.1非根
我还添加了一个例外,我的防火墙端口5555

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:

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过的位置,如桌面)

The Actual Bat file (save this as startAdbWifi.bat where ever, like desktop)

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

很抱歉,如果蝙蝠是可怕的,我的第一个

Sorry if the bat is terrible, one of my first

这篇关于如何连接通过WiFi亚行*拥有便利的BAT文件*的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆