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

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


当前回答

从搜索和一些答案,我使用这个方法,它工作得很好 你必须知道tcpip并不总是5555,你必须按照这个找到它 首先需要下载平台工具

https://developer.android.com/studio/releases/platform-tools.html

解压平台-工具文件夹到C盘,在那里运行Powershell(右键单击>> Powershell >>打开这里)

#用usb线连接手机

PS C:\platform-tools> adb kill-server
PS C:\platform-tools> adb shell ip route > addrs.txt

#给出你的tcpip

* daemon not running; starting now at tcp:5037 
* daemon started successfully
PS C:\platform-tools> adb tcpip 5037
restarting in TCP mode port: 5037

#断开电话 #adb connect <phone_ip>:5037

PS C:\platform-tools> adb connect 192.168.43.1:5037
connected to 192.168.43.1:5037

现在你可以看到你的手机在安卓工作室

其他回答

我通读了每一个答案,发现没有使用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(确保端口是你上面看到的端口,因为它可能与你刚刚输入的端口不同)

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

我为Windows写了一个简单的脚本:

步骤1。用以下命令创建一个批处理文件,调用wifi_dedug.bat文件并复制以下内容:

    adb tcpip 5555
    pause
    adb shell "ip addr show wlan0  | grep 'inet ' | cut -d' ' -f6|cut -d/ -f1" > tmpFile 
    pause
    set /p ip= < tmpFile 
    @echo %ip%
    del tmpFile
    @echo %ip%
    adb connect %ip%
    pause

步骤2。将您的设备连接到pc。

步骤3。启动批处理文件(按要求输入键)

步骤4。断开设备连接,通过wifi进行部署/调试。

只需下载谷歌ADB: https://developer.android.com/studio/releases/platform-tools 提取并利用它。 例如,配对:

./adb pair 192.168.8.90:42119 274678

然后连接:

./adb connect 192.168.8.90:38995

例如使用scopy这样的软件:

export ADB="/home/luca/Downloads/platform-tools/adb"
scrcpy

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

我在这里找到了答案:

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

然后从头再来。