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

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


当前回答

更新:

从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.

其他回答

在Android 11的开发者选项中,有无线调试。确保你的笔记本电脑和手机在同一个网络下,然后执行下面的2个命令。注意,pair的端口与connect的端口不同,第一次只需要配对(以后只需要连接)。

Adb pair ipaddr:端口

adb pair 192.168.1.6:42049

// will output
Enter pairing code: 696686
Successfully paired to 192.168.1.6:42049 ...

Adb connect ipaddr:端口

adb connect 192.168.1.6:37203

// will output
connected to 192.168.1.6:37203

除了 如果你在“platform-tools”目录下,这些命令将只在android studio终端上工作。cd C:\Users\username\AppData\Local\Android\Sdk\平台工具>

以下是标准的步骤(大部分与之前的答案相同):-

Adb tcpip 5555。 Adb connect your_device_ip_address。 Adb设备(查看设备是否已连接)。

但在某些情况下,上述步骤会出现“无法连接到设备”之类的错误。确保你的电脑和设备连接到同一个WiFi网络。”你注意到这些设备已经在同一个网络上了。

在这种情况下,安装这个插件“Wifi ADB Ultimate”,并遵循以下步骤。

通过USB连接设备一次。 刷新列表,检查其是否连通。 进入“关于话机>状态> IP地址”,填写您的IP地址(例如>)。198.162.0.105)。 回到Android Studio,按下图所示填写这个IP,然后点击运行按钮。



现在,您可以开始了!

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

1-为此,我认为你已经安装了最新版本的Android studio。如果没有,你可以从这里下载。

2 -可以在“环境变量”中设置平台工具路径(可选)。

3 -确保你的设备和电脑连接到同一个网络。

plug in the data cable from pc to device. Now, type adb tcpip 5555 remove data cable. Then type adb connect 192.168.43.95 here 5555 is the port number and 192.168.43.95 is the ip address of the mobile device you can get id address from the mobile settings . Then go to About device and go to status you can see the ip address of the device. You can connect multiple device from different ports which can give ease in development. Or you can go to this link for brief description with screenshots. http://blogssolutions.co.in/connect-your-android-phone-wirelessly-by-adb

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