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>
相关推荐
代码敲上天.7 小时前
数据库语句优化
android·数据库·adb
看山还是山,看水还是。12 小时前
MySQL 管理
数据库·笔记·mysql·adb
人工智能的苟富贵20 小时前
Android Debug Bridge(ADB)完全指南
android·adb
卓琢3 天前
(四)Mysql 数据库备份恢复全攻略
数据库·mysql·adb
დ旧言~4 天前
【MySQL】数据类型
android·数据库·mysql·adb
დ旧言~4 天前
【MySQL】MySQL库的操作
android·adb
猿~阿峰5 天前
MySQL
android·mysql·adb
新知图书6 天前
启动服务并登录MySQL9数据库
数据库·adb
在下村刘湘6 天前
MySQL本地安装步骤
数据库·mysql·adb
苏格拉真没有底8 天前
通过 IPv6 进行远程 ADB 调试
adb