1、有线连接
usb线,连接手机和电脑
2、无线连接(adb tcpip)
前提条件:
电脑和手机在同一个局域网下,
连接同一个wifi即可
(1)先使用 usb 线连接手机和电脑,设置手机 tcp 连接端口为5555
➜ /Users/xxx
> adb tcpip 5555
restarting in TCP mode port: 5555
(2)确定手机 ip 地址

(3)断开 usb 线,使用 tcpip 连接手机
➜ /Users/xxx
> adb connect 172.16.133.61:5555
connected to 172.16.133.61:5555
查看连接状态:
➜ /Users/xxx
> adb devices
List of devices attached
172.16.133.61:5555 device
然后就可以在无线状态下,随意使用adb命令了。
(4)断开 tcpip 连接
➜ /Users/xxx
> adb disconnect 172.16.133.61:5555
disconnected 172.16.133.61:5555
查看连接状态:
➜ /Users/xxx
> adb devices
List of devices attached
完成✅

本文介绍如何通过有线和无线方式连接手机与电脑进行ADB调试。首先使用USB线连接并设置手机的TCP端口,之后在同一WiFi下通过无线方式进行连接与断开。文中详细解释了每一步的操作命令。
1019

被折叠的 条评论
为什么被折叠?



