APP测试相关的adb常用命令
一、设备连接与基础
adb devices # 查看已连接设备
adb install -r xxx.apk # 安装(-r 覆盖升级,-t 允许测试包)
adb uninstall com.xxx # 卸载
adb shell getprop ro.build.version.release # 安卓版本
adb shell wm size # 屏幕分辨率
adb reboot / adb reboot recovery # 重启 / 进 recovery
二、App 性能与状态
adb shell dumpsys activity top | findstr "ACTIVITY" # 当前前台 Activity
adb shell dumpsys meminfo com.xxx # 内存占用(观察泄漏/峰值)
adb shell top -n 1 | findstr com.xxx # CPU 占用快照
adb shell dumpsys battery # 电量(耗电测试)
adb shell dumpsys network | findstr com.xxx # App 流量
adb shell screencap /sdcard/s.png && adb pull /sdcard/s.png # 截图拉到电脑
adb shell screenrecord /sdcard/r.mp4 # 录屏(Ctrl+C 结束)
三、调试与抓包辅助
App 性能与状态
原文地址: https://www.cveoy.top/t/topic/qHXB 著作权归作者所有。请勿转载和采集!