APP性能测试-启动时间
2022/3/10 6:16:15
本文主要是介绍APP性能测试-启动时间,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
1.冷启动
冷启动:后台没有该应用程序的进程,应用首次启动。
获取package名
打开APP,然后使用命令
adb shell dumpsys activity | grep mFocusedActivity
adb shell logcat | grep START
adb shell logcat | grep cmp=
adb shell dumpsys activity | findstr mFocusedActivity mFocusedActivity: ActivityRecord{6468932 u0 com.android.contacts/.activities.PeopleActivity t156}
adb shell logcat | findstr START 03-09 22:45:57.809 1637 2939 E ActivityTaskManager: START {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10600000 hwFlg=0x10 cmp=com.lingkou.leetcode/com.lingkou.main.splash.SplashActivity bnds=[648,1619][858,1968] (has extras)} result: 2
启动APP:
adb shell am start -W -n <package/activity>
adb shell am start -W -n com.android.contacts/.activities.PeopleActivity Starting: Intent { cmp=com.android.contacts/.activities.PeopleActivity } Status: ok Activity: com.android.contacts/.activities.PeopleActivity ThisTime: 334 TotalTime: 334 WaitTime: 375 Complete
停止APP:
adb shell am force-stop package
2.热启动
热启动:后台已经有了该程序的进程(返回,home键退出让应用程序在后台继续执行)当再次点开APP马上能够恢复到上次使用的状态,不需要再回到手机的首页打开应用程序。
adb shell input keyevent 3(home键)
adb shell input keyevent 4(返回)
参考:
https://blog.csdn.net/gufenchen/article/details/91410667
https://www.cnblogs.com/zhangwei-qianqian/p/11887627.html
https://blog.csdn.net/h_bpdwn/article/details/91425599
这篇关于APP性能测试-启动时间的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-09-28微服务架构中API版本控制的实践
- 2024-09-28AI给的和自己写的Python代码,都无法改变输入框的内容,替换也不行
- 2024-09-27Sentinel配置限流资料:新手入门教程
- 2024-09-27Sentinel配置限流资料详解
- 2024-09-27Sentinel限流资料:新手入门教程
- 2024-09-26Sentinel限流资料入门详解
- 2024-09-26Springboot框架资料:初学者入门教程
- 2024-09-26Springboot框架资料详解:新手入门教程
- 2024-09-26Springboot企业级开发资料:新手入门指南
- 2024-09-26SpringBoot企业级开发资料新手指南