adb常用指令
ADB(Android Debug Bridge)是一个强大的命令行工具,用于与连接的Android设备进行通信。
1:安装软件包,假设app安装包为apk
adb install [apk]
2:查看当前连接PC的安卓设备编号
adb devices
3:选择具体的设备,假设设备的编号是device
adb -s [device]
4:挂载monkey进程,假设app为package
adb shell monkey -p [package]
5:查看本地N条日志并存储到相应路径,假设N=1000,路径为D盘根目录
adb logcat -t 1000 > d:\\log.txt
6:获取安卓设备的root权限
adb root
7:查看APP启动相关的时间,假设app活动为activity
adb shell am start -W [activity]
8:查看当前屏幕的活动
adb shell dumpsys window w |findstr \/ | findstr name =
9:测试设备内存
adb shell dumpsys meminfo
10:测试设备温度
adb shell dumpsys battery
11:开启本地日志
adb shell setprop log.tag.FA VERBOSE
adb shell setprop log.tag.FA-SVC VERBOSE
12:logcat筛查关键字,假设关键字为keywords
adb logcat | grep " keywords "
13:开启firebase debugview,假设app为package
adb shell setprop debug.firebase.analytics.app [package]
14:关闭firebase debugview
adb shell setprop debug.firebase.analytics.app .none.