我认为有一种方法可以通过Wi-Fi测试开发中的应用程序。这可能吗?

我希望能够解开我的手机,无线开发。


当前回答

adb实用程序能够通过TCP/IP连接到设备。但是,adbd通常不会监听TCP连接。

如果您想让它运行,您需要一个工程设备(换句话说,您需要root)。然后按照这篇文章中的指导去做:

如何通过TCP连接到ADB的Android ?

由于这只适用于eng设备,所以它不受官方支持。使用风险自负,包括bug等。

其他回答

对于所有这些,有一个更好的方法(最简单的方法):

1) Android工作室出口插件,称为Android wifi ADB

2)进入文件->设置->插件->浏览存储库

3)寻找Android WiFi ADB,点击INSTALL,然后按提示重启

4)你会看到一个新的图标,这是你的新插件。

现在要做到这一点:

5)去你的手机的开发者选项并打开调试(必须)

6)也启用,允许调试TCP/网络

7)通过USB连接你的手机,并确保手机和你的电脑/笔记本电脑都连接到同一个网络(热点或wifi)

8)点击新的图标(即你的ANDROID Wifi ABD)

9)你的手机被检测到并通过wifi/热点连接,因此现在你可以断开usb。这是一个一次性的过程,因此你可能不需要保持手机连接usb。

这将使你的手机免于不定期的充电,同时,也是短长度usb线的补救措施。

拉杜·西米内斯库的回答对我很管用。谢谢你!对于无法看到android设备ip地址的用户,请转到 >无线> Wi-Fi 然后长按已连接的wifi。然后选择“显示高级选项”上的“修改网络配置检查”,并滚动到IP地址部分。

在系统中安装adb后,请运行 Killadd adb和adb start-server 刷新adb。有时我们会遇到这样的问题

当你按照上面的答案https://stackoverflow.com/a/10236938/6117565,你可能会得到错误“没有路由到主机”。

要解决这个问题,在上述回答的第5步之前,首先启动模拟器,然后尝试连接设备。不知道发生了什么,但这个把戏奏效了。

我在这里找到了答案:

Connect Android device and adb host computer to a common Wi-Fi network accessible to both. We have found that not all access points are suitable; you may need to use an access point whose firewall is configured properly to support adb. Connect the device with USB cable to host. Make sure adb is running in USB mode on host. $ adb usb restarting in USB mode Connect to the device over USB. $ adb devices List of devices attached ######## device Restart host adb in tcpip mode. $ adb tcpip 5555 restarting in TCP mode port: 5555 Find out the IP address of the Android device: Settings -> About tablet -> Status -> IP address. Remember the IP address, of the form #.#.#.#. sometimes its not possible to find the IP-address of the android device, as in my case. so u can get it using adb as the following: $ adb shell netcfg and the should be in the last line of the result. Connect adb host to device: $ adb connect #.#.#.# connected to #.#.#.#:5555 Remove USB cable from device, and confirm you can still access device: $ adb devices List of devices attached #.#.#.#:5555 device

现在可以开始了!

如果adb连接丢失:

确保你的主机仍然连接到你的Android设备所在的Wi-Fi网络。 再次执行“adb connect”步骤重新连接。 或者如果这不起作用,重置你的adb主机: 亚行kill-server

然后从头再来。

Windows:

步骤1。使用下面的命令创建一个批处理文件,并将该文件称为w.bat。

步骤2。将下面的内容复制到w.b bat中,并保存在Windows系统%path%中的任意文件夹中

echo ***Get phone in Wi-Fi mode***
echo ***Get phone in Wi-Fi mode***

adb devices
echo ***Remove cable from the phone now***
adb tcpip 9000

adb connect 192.168.1.1:9000
adb connect 192.168.1.2:9000
adb connect 192.168.1.3:9000
adb connect 192.168.1.4:9000
adb connect 192.168.1.5:9000
adb connect 192.168.1.6:9000

<--到这里-->

步骤3。用数据线连接你的手机和电脑

步骤4。确保手机处于Wi-Fi模式

第5步。当批处理文件要求您移除电缆时

步骤6。在Windows提示符上输入w.bat (start -> run -> Type CMD,按Enter)(黑屏是Windows DOS提示符),如果你在其中一个路径文件夹中复制了它,那么你可以从任何地方运行,否则从你创建这个文件的文件夹运行。

批处理文件的输出如下所示:

C:\Windows\System32>w

C:\Windows\System32>echo ***Get phone in Wi-Fi mode***
***Get phone in Wi-Fi mode***

C:\Windows\System32>echo ***Get phone in Wi-Fi mode***
***Get phone in Wi-Fi mode***

C:\Windows\System32>adb devices
List of devices attached
d4e9f06 device

C:\Windows\System32>echo ***Remove cable from the Phone now***
***Remove cable from the Phone now***

C:\Windows\System32>adb tcpip 9000
restarting in TCP mode port: 9000

C:\Windows\System32>adb connect 192.168.1.1:9000
unable to connect to 192.168.1.1:9000:9000

C:\Windows\System32>adb connect 192.168.1.2:9000
connected to 192.168.1.2:9000

C:\Windows\System32>adb connect 192.168.1.3:9000
unable to connect to 192.168.1.3:9000:9000

C:\Windows\System32>adb connect 192.168.1.4:9000
unable to connect to 192.168.1.4:9000:9000

C:\Windows\System32>adb connect 192.168.1.5:9000
unable to connect to 192.168.1.5:9000:9000

C:\Windows\System32>adb connect 192.168.1.6:9000
unable to connect to 192.168.1.6:9000:9000

注1:在输出中找到这个,(忽略所有->unable to connect<- errors)

connected to xxx.xxx.x.x:9000

如果你在结果中看到这个,只需从PC上移除电缆,进入Eclipse并运行在设备上安装应用程序;应该是这样。

注意2:断开或切换无线模式关闭:键入下面的命令。它应该说在USB模式下重新启动-在这个阶段PC和计算机不应该用电缆连接:

C:\Users\dell>adb usb
restarting in USB mode

注3:查找话机IP地址的步骤(取自Stack Overflow)

查找MY PHONE的IP地址:

a. Dial *#*#4636#*#* to open the Testing menu.
b. In the Wi-Fi information menu: click Wi-Fi Status
c. Wi-Fi status can be blank for the first time
d. Click Refresh Status
e. In the IPaddr: <<IP ADDRESS OF THE PHONE IS LISTED>>

注4:我的手机Wi-Fi连接IP地址范围一般为下面提到的IP地址,

192.168.1.1

192.168.1.2

192.168.1.3

192.168.1.4

192.168.1.5

192.168.1.6

注意5:如果你得到的IP地址序列不断被重新分配给你的手机,你可以在w.b bat文件中修改IP地址。

注意6:这是一种强制方法,它消除了寻找IP地址和连接到Eclipse / Wi-Fi的所有手工劳动。

所以简而言之,常规的活动应该是这样的:

Step 1. Connect PC and Wi-Fi via a cable
Step 2. Start CMD - to go to Windows DOS prompt
Step 3. Type "w"
Step 4. Find connected command in the output
Step 5. Success, remove cable and start using Eclipse