一、ADB命令
1、获取app的包名:adb shell am monitor
2、获取app的Activity名: adb shell dumpsys package 包名
3、获取app的启动时间:adb shell am start 包名/Activity
app启动状态有三种 冷启动 温启动 热启动
TotalTime: 应用自身启动耗时, 该Activity的启动耗时+应用application等资源启动时间;
WaitTime: 系统启动应用耗时, TotalTime+系统资源启动时间
4、获取app占用cpu、内存信息:
adb shell dumpsys cpuinfo包名
adb shell dumpsys meminfo 包名
动态获取性能信息
adb shell
ps -ef|grep 包信息 获取到进程ID
top -p 进程ID -d 10 -n 5 每10s更新一次 一共刷新5次