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 小时前
荣耀手机,系统MagicOS 9.0 USB配置没有音频来源后无法被adb检测到,无法真机调试的解决办法
adb·uni-app
xx155802862xx13 小时前
在CentOS 7上仅安装部署MySQL 8.0客户端
mysql·adb·centos
CYRUS STUDIO1 天前
adb 实用命令汇总
android·adb·命令模式·工具
冰箱上的笑话2 天前
MySQL 数据库故障排查指南
数据库·mysql·adb
吻等离子2 天前
解决 MySQL 数据库无法远程连接的问题
数据库·mysql·adb
血手人屠喵帕斯2 天前
事务连接池
android·adb
tiwolf_li2 天前
使用adb设置wifi相关
adb
一人一萧十只猫�2 天前
MySQL 从入门到精通(三):日志管理详解 —— 从排错到恢复的核心利器
android·mysql·adb
hnlucky3 天前
《Zabbix Proxy分布式监控实战:从安装到配置全解析》
数据库·分布式·学习·adb·zabbix·集成学习·proxy模式
鬼才血脉3 天前
Ubuntu上安装MySQL 8并配置Navicat远程连接
mysql·ubuntu·adb