adb 启动app并查看启动时间

启动app

  • adb shell am start -n 包名/界面名

获取app的启动时长

  • adb shell am start -W 包名/界面名

要启动一个app 就需要知道其包名与界面名,提前打开一个程序,然后执行以下程序

复制代码
C:\Users\i5ba0>adb shell dumpsys window windows | findstr mFocusedApp
  mFocusedApp=AppWindowToken{1db96c05 token=Token{2264db7c ActivityRecord{859126f u0 cn.goapk.market/com.anzhi.market.ui.MainActivity t4}}}

C:\Users\i5ba0>

包名/界面名:cn.goapk.market/com.anzhi.market.ui.MainActivity t4

启动app

复制代码
C:\Users\i5ba0>adb shell am start -n cn.goapk.market/com.anzhi.market.ui.MainActivity t4
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] pkg=t4 cmp=cn.goapk.market/com.anzhi.market.ui.MainActivity }

C:\Users\i5ba0>

查看其启动时间时间

复制代码
C:\Users\i5ba0>adb shell am start -W cn.goapk.market/com.anzhi.market.ui.MainActivity t4
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=cn.goapk.market/com.anzhi.market.ui.MainActivity }
Warning: Activity not started, its current task has been brought to the front
Status: ok
Activity: cn.goapk.market/com.anzhi.market.ui.MainActivity
ThisTime: 0
TotalTime: 0
WaitTime: 2
Complete

C:\Users\i5ba0>
相关推荐
蓝眸少年CY7 小时前
MaxWell 高级教程
adb
seabirdssss1 天前
Flutter 开发环境配置
android·windows·flutter·adb
不会写DN1 天前
如何排查 MySQL 慢查询
数据库·mysql·adb
su_ym81101 天前
adb原理及常用命令介绍
adb
REDcker1 天前
Android ADB 命令教程与速查
android·adb
l1o3v1e4ding1 天前
排查linux CentOS7.6的mysql(5.7.27)内存泄漏因OOM被系统kill的问题
linux·mysql·adb
java资料站2 天前
Docker 快速部署 MySQL 主从复制(一主一从)
mysql·adb·docker
Trouvaille ~2 天前
【MySQL】视图:虚拟表的妙用
数据库·mysql·adb·面试·数据处理·后端开发·视图
Fᴏʀ ʏ꯭ᴏ꯭ᴜ꯭.2 天前
MySQL高可用集群实战:MHA搭建全攻略
android·mysql·adb
姓王名礼2 天前
如果CentOS系统时间正确但MySQL数据库时间不正确
adb