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>
相关推荐
gp3210261 小时前
开放自己本机的mysql允许别人连接
数据库·mysql·adb
AI+程序员在路上3 小时前
瑞芯微 RV1126B ADB 调试命令完全指南
linux·adb
ego.iblacat4 小时前
在 LNMP 平台中部署 Web 应用
android·前端·adb
pupudawang4 小时前
docker 安装 mysql
mysql·adb·docker
tntlbb4 小时前
苍穹外卖Day1:项目数据库连接问题排查与原理分析报告
android·adb
shuangrenlong5 小时前
adb连接无线wifi
adb
jolimark16 小时前
MySQL--》如何在MySQL中打造高效优化索引
android·mysql·adb
CS_Zero1 天前
Android ADB调试工具使用简记
android·adb
倔强的石头1061 天前
MySQL 兼容性深度解析:从内核级优化到“零修改”迁移工程实践
数据库·mysql·adb·kingbase
猿月亮1 天前
MySQL5.7安装图文详细步骤(保姆级教程)-mysql5.7下载安装
mysql·adb