我认为有一种方法可以通过Wi-Fi测试开发中的应用程序。这可能吗?
我希望能够解开我的手机,无线开发。
我认为有一种方法可以通过Wi-Fi测试开发中的应用程序。这可能吗?
我希望能够解开我的手机,无线开发。
当前回答
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
其他回答
从搜索和一些答案,我使用这个方法,它工作得很好 你必须知道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
现在你可以看到你的手机在安卓工作室
这里可能漏掉了一个imp点-一旦您执行adb重新挂载- TCP连接丢失,因此您必须再次执行adb连接IP:port
更新:
从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设备ip地址的用户,请转到 >无线> Wi-Fi 然后长按已连接的wifi。然后选择“显示高级选项”上的“修改网络配置检查”,并滚动到IP地址部分。
在系统中安装adb后,请运行 Killadd adb和adb start-server 刷新adb。有时我们会遇到这样的问题
在游戏商店下载应用程序Wifi ADB。非常容易使用,工作就像一个魅力!:)