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

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


当前回答

在设备设置->“开发人员选项”->“撤销USB调试授权”。 通过USB连接设备并确保调试工作正常。 Adb tcpip 5555 adb connect <DEVICE_IP_ADDRESS>:5555 断开USB 亚洲开发银行设备

其他回答

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

使用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)。

如果你想在设备上启用无线adb,而不需要连接USB线(root要求):

在设备上安装终端应用程序(如Android终端模拟器) 输入以下内容 苏 Setprop service.adb.tcp.port 5555 停止adbd 开始adbd

因为你已经打开了终端,你可以找到设备的IP地址:

ip addr show

然后在调试环境中运行命令:

adb connect ip.of.the.device

这将使该设备被列为您可能拥有的任何其他模拟器。请注意,在重置设备之前,TCP将保持打开状态。 如果你经常断网,你可能还想安装一个Wi-Fi Keep Alive应用程序。

如果你想要安全,记得在连接到公共网络时关闭TCP。您可以执行以下操作或简单地重新启动设备:

苏 Setprop service.adb.tcp.port -1 停止adbd 开始adbd

最好的方法是使用ADBConnect (Eclipse插件)和ADB Wireless (Android设备应用程序)。

更新:

从Android Studio Bumblebee(2021.1.1)稳定版开始,你可以通过扫描二维码对设备进行Wifi调试。

引用博客文章:

通过Wi-Fi的ADB: Bumblebee包括一个简化的连接流程 你的Android 11和更高版本的设备通过Wi-Fi进行部署 使用ADB调试。在你的 的“物理”选项卡中选择“使用Wi-Fi动作的对” 新建设备管理器打开配对向导。然后按照下面的步骤 提供用于与通过同一网络连接的设备配对。学习 更多。


老帖:

有了新的Android 11,你可以在WiFi上调试你的应用程序,而完全不需要使用USB线。

引用自Android Studio用户指南

Connect to a device over Wi-Fi (Android 11+) Android 11 and higher support deploying and debugging your app wirelessly from your workstation using Android Debug Bridge (adb). For example, you can deploy your debuggable app to multiple remote devices without physically connecting your device via USB. This eliminates the need to deal with common USB connection issues, such as driver installation. To use wireless debugging, you need to pair your device to your workstation using a pairing code. Your workstation and device must be connected to the same wireless network. To connect to your device, follow these steps: On your workstation, update to the latest version of the SDK Platform-Tools. On the device, enable developer options. Enable the Wireless debugging option. On the dialog that asks Allow wireless debugging on this network?, click Allow. Select Pair device with pairing code. Take note of the pairing code, IP address, and port number displayed on the device (see image). On your workstation, open a terminal and navigate to android_sdk/platform-tools. Run adb pair ipaddr:port. Use the IP address and port number from step 5. When prompted, enter the pairing code that you received in step 5. A message indicates that your device has been successfully paired. none Enter pairing code: 482924 Successfully paired to 192.168.1.130:37099 [guid=adb-235XY] (For Linux or Microsoft Windows only) Run adb connect ipaddr:port. Use the IP address and port under Wireless debugging.