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

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


当前回答

对于Ubuntu / Linux:

Make sure your device is working for debugging: http://developer.android.com/tools/help/adb.html#Enabling Go to your sdk folder and find the folder platform-tools Use ./adb devices to list the connected devices. Make sure it is only one device connected and no emulator running. Find your device IP address, you can find it in your device: http://developer.android.com/tools/help/adb.html#wireless, or got adb shell like this: ./adb shell then netcfg. You will see a list of IP addresses. Find wlan0, in my case 192.168.100.3/2. ./adb tcpip 5555 Finally enter ./adb connect <Your device IP Address>:5555 in your terminal. You can now deploy the application to your device over Wi-Fi.

其他回答

这里可能漏掉了一个imp点-一旦您执行adb重新挂载- TCP连接丢失,因此您必须再次执行adb连接IP:port

first you shold connect your device with usb to pc after that run cmd and drag and drop adb.exe that is in sdk/platform-tools path and write below code :

    ....\Sdk\platform-tools\adb.exe devices

    .....\Sdk\platform-tools\adb.exe tcpip 5555

    .....\Sdk\platform-tools\adb.exe connect Ip address:5555

我通读了每一个答案,发现没有使用android和根的方法。(使用android 11)

1)。使用termux,我安装了android-tools包,这很容易遵循termux的wiki。

2)打开设置->无线调试:并切换无线调试

3.)单击“配对设备与配对码”。

4)。使用设置应用程序和termux启用分屏。在termux中(设置应用程序仍然打开)输入命令adb pair ip:port(这里的端口就是你在上面的分屏中看到的端口)

5.)它会问你一个代码,再次使用你看到的分屏设置应用程序。

6.)在termux中输入命令adb connect ip:port(确保端口是你上面看到的端口,因为它可能与你刚刚输入的端口不同)

整个过程可以自动使用任务器,我不会张贴在这里,因为我发现它快速和容易手动完成,但任务器的创造者有一个指南在这里的某个地方。

虽然有这么多好的答案,这里是我对未来的我的两点意见:P和任何想要快速简单的人。

Mac:

首先使用USB连接设备,并确保调试工作正常。断开任何其他设备并退出模拟器。 打开终端,运行以下脚本 Adb tcpip 5555 Adb connect $(Adb shell ifconfig | grep "inet " | grep -v 127.0.0.1 | awk '{print $2}' | cut -d: -f2):5555 断开USB连接,设备应可进行WiFi调试

解释:

Adb tcpip 5555命令设备开始监听端口5555上的连接

Adb connect $(_ip_address_fetched_):5555表示连接到_ip_address_fetched_地址的5555端口

其中_ip_address_fetched_包含以下内容:

Adb shell ifconfig使用Adb shell获取Internet配置

Grep "inter "过滤任何以inter开头的行

排除本地主机。

此时,输出应该是这样的:

inet addr :###.###.#.# # #广播地址 :###.###.#.# # #面具:255.255.255.0

awk '{print $2}'获取组件数组的第二部分,用空格分隔(我使用zsh)。

到此为止的输出是

addr :###.###.#.###

Cut -d: -f2用分隔符分割字符串,然后取第二部分。它只会接收你的设备IP地址

对于Ubuntu / Linux:

Make sure your device is working for debugging: http://developer.android.com/tools/help/adb.html#Enabling Go to your sdk folder and find the folder platform-tools Use ./adb devices to list the connected devices. Make sure it is only one device connected and no emulator running. Find your device IP address, you can find it in your device: http://developer.android.com/tools/help/adb.html#wireless, or got adb shell like this: ./adb shell then netcfg. You will see a list of IP addresses. Find wlan0, in my case 192.168.100.3/2. ./adb tcpip 5555 Finally enter ./adb connect <Your device IP Address>:5555 in your terminal. You can now deploy the application to your device over Wi-Fi.