我认为有一种方法可以通过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

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

其他回答

我为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进行部署/调试。

在游戏商店下载应用程序Wifi ADB。非常容易使用,工作就像一个魅力!:)

经过长时间的搜索,我发现:

我得走了

adb connect <device_ip_address>:5555 

断开USB后。

使用ADB调试Android Wifi的步骤:

$> adb devices   // check all usb debuggable devices connected.

$> adb -d shell  // Access device shell.

shell> ifconfig  // Check and copy wifi ip-address eg:192.168.1.90

shell> exit      // Exit from android device shell.

$> adb tcpip 5000   // open TCP port 5000 (or any available)

$> adb connect 192.168.1.90:5000  // connect to device via wifi ip over specific TCP port.

$> adb devices   // you will get debuggabled android device over wifi.

必备:通过USB连接您的android设备到计算机 启用开发人员模式。同时将你的android设备和电脑连接起来 到同一个wifi路由器(或使用tethering)。

2021年8月编辑

谷歌用ArcticFox Beta 03 https://issuetracker.google.com/issues/190411383删除了它,但在Android Studio Bumblebee它仍然存在。看起来他们有很多问题,这就是为什么它只是金丝雀版本

最初的发布

这个Android WiFi ADB插件不能在4.1.1中工作(不再)

但有一个更简单的解决方案: 如果你有Android 11 (api30)设备,你应该使用Android Studio 2020.3.1 (Canary)来连接。非常简单

然后进入开发者设置,扫描二维码。就是这样。 你现在也可以在其他(旧的)Android Studio版本中使用连接设备