查看当前界面Activity的方法:
1)运行命令:adb shell dumpsys window | findstr "mCurrentFocus"
mCurrentFocus=Window{227cb04 u0 com.oppo.music/com.oppo.music.MainListActivity}
从结果中可知:
当前应用包名:com.oppo.music
当前界面Activity:com.oppo.music.MainListActivity
2)查看应用的PID
adb shell ps | findstr “com.oppo.music”,找到PID对应的列
1、“高速摄像机或Iphone慢动作”查看应用的启动时间
1)使用高速相机或Iphone的慢动作(240ps)录制应用的启动视频
2)使用QucikTime的帧分析功能,确定好起始帧(手指按下抬起时)和结束帧(应用完全显示)
3)根据帧数计算启动时间:=1000*帧数量/240
备注:最接近真实用户使用场景,但是操作复杂,成本高
2、“ActivityManager”查看应用的启动时间
备注:系统main log中也会有对应的显示(或adb shell logcat -b main | findstr ActivityManager)更佳
1)运行结果:
04-19 15:13:25.919 1181 1216 I ActivityManager: Displayed com.oppo.m