我认为有一种方法可以通过Wi-Fi测试开发中的应用程序。这可能吗?
我希望能够解开我的手机,无线开发。
我认为有一种方法可以通过Wi-Fi测试开发中的应用程序。这可能吗?
我希望能够解开我的手机,无线开发。
当前回答
以下是标准的步骤(大部分与之前的答案相同):-
Adb tcpip 5555。 Adb connect your_device_ip_address。 Adb设备(查看设备是否已连接)。
但在某些情况下,上述步骤会出现“无法连接到设备”之类的错误。确保你的电脑和设备连接到同一个WiFi网络。”你注意到这些设备已经在同一个网络上了。
在这种情况下,安装这个插件“Wifi ADB Ultimate”,并遵循以下步骤。
通过USB连接设备一次。 刷新列表,检查其是否连通。 进入“关于话机>状态> IP地址”,填写您的IP地址(例如>)。198.162.0.105)。 回到Android Studio,按下图所示填写这个IP,然后点击运行按钮。
现在,您可以开始了!
其他回答
更新:
从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.
对于所有这些,有一个更好的方法(最简单的方法):
1) Android工作室出口插件,称为Android wifi ADB
2)进入文件->设置->插件->浏览存储库
3)寻找Android WiFi ADB,点击INSTALL,然后按提示重启
4)你会看到一个新的图标,这是你的新插件。
现在要做到这一点:
5)去你的手机的开发者选项并打开调试(必须)
6)也启用,允许调试TCP/网络
7)通过USB连接你的手机,并确保手机和你的电脑/笔记本电脑都连接到同一个网络(热点或wifi)
8)点击新的图标(即你的ANDROID Wifi ABD)
9)你的手机被检测到并通过wifi/热点连接,因此现在你可以断开usb。这是一个一次性的过程,因此你可能不需要保持手机连接usb。
这将使你的手机免于不定期的充电,同时,也是短长度usb线的补救措施。
确保你的电脑和安卓系统连接在同一个wifi上。 从你的手机启动adb服务器… 从playstore下载任何无线adb应用程序…这是我正在用的 无线ADB -空中调试 在您的计算机上启动CMD并运行: 代码(csharp): Adb连接192.168.1.100:5555 请确保将192.168.1.100替换为实际分配给设备的IP地址。
检查是否通过以下方式连接: 代码(csharp): 亚洲开发银行设备 4. 启动统一或重新启动,如果它已经运行并点击播放。
tadaa...........:eek:
我为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进行部署/调试。
>## open command prompt with Run as Administrtor ##
adb connect ipdevice:5037