adb 测试android 应用的启动时间

1.查看需要测试启动时间的app的包名和Activity名,在打开app的前提下输入

# windows : 
adb shell dumpsys activity | findstr "mResume" 或者 adb shell dumps window windows | findstr "mFocusedApp"

# linux :  
adb shell dumpsys activity | grep "mResume"

2 包名:com.tpshop.malls , Activity名:.activity.common.SPImagePreviewActivity

3.输入下面命令

adb shell am start -W -n  com.tpshop.malls/.activity.common.SPImagePreviewActivity

结果如下:

我们需要关注的是ThistTime 和 Totaltime
Totaltime : 应用的启动时间,包括创建线程的时间、App初始化、Activity初始化到界面显示

posted @ 2021-12-21 12:17  chuangzhou  阅读(552)  评论(0)    收藏  举报