1. 查看版本

adb version

2. 查看adb设备

adb.exe devices

返回

E:\_1\qrs\tools\scrcpy-win64-v3.2>adb.exe devices
List of devices attached
f3ec0fc48fafc16f        device

3. 连接设备

如果只有一个设备

adb shell

如果有多个设备,需要指定连接的设备

3.1 安卓设备

adb connect HOST[:PORT]

3.2 Linux设备

adb -s f3ec0fc48fafc16f shell

4.电脑推送文件到设备

adb push <电脑文件路径> <设备路径>

test

adb push D:\Desktop\error.log /root
D:\Desktop\error.log: 1 file pushed, 0 skipped. 13.6 MB/s (3304 bytes in 0.000s)

5.复制设备文件到电脑

adb pull <设备文件路径> <电脑路径>

test(注意不能放在D盘(盘符)根目录,只能放在之下的目录)

adb p1ull /root/error.log D:\yc
/root/error.log: 1 file pulled, 0 skipped. 1.1 MB/s (3304 bytes in 0.003s)