我认为有一种方法可以通过Wi-Fi测试开发中的应用程序。这可能吗?
我希望能够解开我的手机,无线开发。
我认为有一种方法可以通过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.
其他回答
要完成@usethe4ce的回答,如果您有多个设备或模拟器,adb tcpip 5555将给出错误:多个设备/模拟器。
在这种情况下,您需要给出所需设备的序列号:
亚洲开发银行设备 所附设备清单 33001229的设备 模拟器- 5554设备 Adb -s 33001229 tcpip 5555 在我的情况下,我可以从设备的wifi连接设置中找到它。 Adb connect xxx.xxx.xxx.xxx:5555
在设备设置->“开发人员选项”->“撤销USB调试授权”。 通过USB连接设备并确保调试工作正常。 Adb tcpip 5555 adb connect <DEVICE_IP_ADDRESS>:5555 断开USB 亚洲开发银行设备
我在这里找到了答案:
Connect Android device and adb host computer to a common Wi-Fi network accessible to both. We have found that not all access points are suitable; you may need to use an access point whose firewall is configured properly to support adb. Connect the device with USB cable to host. Make sure adb is running in USB mode on host. $ adb usb restarting in USB mode Connect to the device over USB. $ adb devices List of devices attached ######## device Restart host adb in tcpip mode. $ adb tcpip 5555 restarting in TCP mode port: 5555 Find out the IP address of the Android device: Settings -> About tablet -> Status -> IP address. Remember the IP address, of the form #.#.#.#. sometimes its not possible to find the IP-address of the android device, as in my case. so u can get it using adb as the following: $ adb shell netcfg and the should be in the last line of the result. Connect adb host to device: $ adb connect #.#.#.# connected to #.#.#.#:5555 Remove USB cable from device, and confirm you can still access device: $ adb devices List of devices attached #.#.#.#:5555 device
现在可以开始了!
如果adb连接丢失:
确保你的主机仍然连接到你的Android设备所在的Wi-Fi网络。 再次执行“adb connect”步骤重新连接。 或者如果这不起作用,重置你的adb主机: 亚行kill-server
然后从头再来。
我通读了每一个答案,发现没有使用android和根的方法。(使用android 11)
1)。使用termux,我安装了android-tools包,这很容易遵循termux的wiki。
2)打开设置->无线调试:并切换无线调试
3.)单击“配对设备与配对码”。
4)。使用设置应用程序和termux启用分屏。在termux中(设置应用程序仍然打开)输入命令adb pair ip:port(这里的端口就是你在上面的分屏中看到的端口)
5.)它会问你一个代码,再次使用你看到的分屏设置应用程序。
6.)在termux中输入命令adb connect 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.