ADB常用命令
学习目标
1. ADB命令简介
ADB全名Andorid Debug Bridge。 是一个Debug工具。为何称之为Bridge呢?
因为adb是一个标准的C/S结构的工具, 是要连接开发电脑和调试手机的
包含如下几个部分:
1.Client端,运行在开发机器中,即你的开发PC机。用来发送adb命令。
2.Daemon守护进程, 运行在调试设备中, 即的调试手机或模拟器。
3.Server端, 作为一个后台进程运行在开发机器中, 即你的开发PC机. 用来管理PC中的Client端和手机的Daemon之间的通信。
2. 常用命令
adb --help
adb start-server
adb kill-server
adb devices
adb shell getprop ro.build.version.release
adb push 电脑端⽂件路径/需要发送的文件,手机端存储的路径
adb push C:\Users\win\Desktop\xx.png /sdcard
adb pull 手机端的路径/拉取文件名 电脑端存储文件路径
adb pull /sdcard/xx.png C:\Users\win\Desktop
adb logcat
adb shell
- 获取app启动包名和启动名(⚠手机需要先打开对应app)
1.Mac/Linux: 'adb shell dumpsys window windows | grep mFocusedApp’
2.在 Windows 终端运⾏ 'adb shell dumpsys window windows | findstr mFocusedApp’
adb install 路径/xxx.apk
adb uninstall app
adb shell am start -W 包名/.启动名