adb常用命令

USB连接电脑,打开USB调试模式。

adb devices # 列出设备,包含SERIAL和设备型号
adb devices -l # 列出详细信息,包含transport id

adb shell <cmd> # 在手机shell中执行命令
adb -t <transport_id> shell <cmd> # 用transport id指定设备(适用于连接了多个设备时)
adb -s <SERIAL> shell <cmd> # 用serial指定设备

adb shell # 进入shell
adb push <local>... <remote> # 从电脑复制文件到手机 remote是手机上的路径
adb pull <remote>... <local> # 从手机上复制文件到电脑

adb install xxx.apk # 安装软件(需要手机确认或者开启权限)
adb shell pm list packages # 列出软件包

附录:
https://zhuanlan.zhihu.com/p/89060003

posted @ 2023-01-15 18:32  王冰冰  阅读(64)  评论(0编辑  收藏  举报