如何通过WiFi使用adb? [英] How can I use adb over WiFi?

查看:141
本文介绍了如何通过WiFi使用adb?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在调试连接到Android手机的USB设备,这意味着我无法通过USB连接使用ADB。如何通过WiFi连接到adb?

I am debugging USB devices connected to my Android phone, this means I cannot use ADB over a USB connection. How can I connect to adb over WiFi?

注意:类似的问题指的是tcp上的adb,但是,我专门询问的是WiFi。

Note: Similar question here refers to adb over tcp, however, I'm specifically asking about WiFi.

推荐答案


  • 将Android手机和主机连接到同一WiFi网络

  • 使用 USB电缆(首先)将Android手机连接到主机

  • 运行 adb tcpip 5555 在命令提示符下

  • 运行 adb shell ip addr show wlan0 | grep -e wlan0 $ | cut -d\ \ -f 6 | cut -d / -f 1 获取电话的IP地址

  • 断开USB电缆的连接,然后运行 adb connect< ip_address> :5555

    • Connect Android phone and host machine to same WiFi network
    • Connect Android phone to host machine using USB cable (to start with)
    • Run adb tcpip 5555 from a command prompt
    • Run adb shell "ip addr show wlan0 | grep -e wlan0$ | cut -d\" \" -f 6 | cut -d/ -f 1" to obtain the phone's IP address
    • Disconnect USB cable and run adb connect <ip_address>:5555
    • 您现在可以通过运行 adb logcat来查看logcat输出或查看Android Studio中的 Android监视器标签。

      You can now view logcat output by running adb logcat or by viewing the Android Monitor tab within Android Studio.

      这篇关于如何通过WiFi使用adb?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆