开始使用 adb WiFi 调试模式

使用 adb WiFi 调试模式,通过以下几个步骤即可完成(开始这些配置之前先确保你的 adb 环境是配置好的):

  • 确保 Android 手机和电脑连接的是同一局域网的 WiFi;

  • 通过 USB 线连接 Android 手机;

  • 设置手机侦听端口 5555 上的 TCP/IP 连接:

 

$ adb tcpip 5555

※ 注意: 如果有多个手机连接在电脑上,需要用 -s ‘serial_number’ 参数指定目标手机,比如:

 

$ adb -s '04157df4d349bf21' tcpip 5555

在命令行中看到 TCP mode port: 5555 就表示监听成功:

 

~/Downloads » adb tcpip 5555
restarting in TCP mode port: 5555
~/Downloads » adb -s '04157df4d349bf21' tcpip 5555
restarting in TCP mode port: 5555

  • 通过 connect 命令和 IP 地址以及端口号连接到目标手机,比如:

 

$ adb connect 192.168.1.146:5555

当看到 connected to xxx:5555 的提示语就表示连接成功:

 

~/Downloads » adb connect 192.168.1

你可能感兴趣的:(android)