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>
相关推荐
练小杰3 小时前
【Mysql-installer-community-8.0.26.0】Mysql 社区版(8.0.26.0) 在Window 系统的默认安装配置
数据库·sql·mysql·adb·配置文件·mysql安装·关系型数据库
袁美丽..10 小时前
Android studio的adb和终端的adb互相抢占端口
android·adb·android studio
fatiaozhang95271 天前
浪潮CD1000-移动云电脑-RK3528芯片-2+32G-安卓9-2种开启ADB ROOT刷机教程方法
android·网络·adb·电脑·电视盒子·刷机固件·机顶盒刷机
黎宇幻生1 天前
Java全栈学习笔记30
android·adb
今人不见古时月,今月曾经照古人3 天前
将 Android 设备的所有系统日志(包括内核日志、系统服务日志等)完整拷贝到 Windows 本地
windows·adb
zhangphil3 天前
Android adb shell命令分析应用内存占用
android·adb
华农第一蒟蒻3 天前
Elasticsearch赋能3D打印机任务统计分析
java·大数据·spring boot·后端·elasticsearch·adb·maven
一个CCD3 天前
MySQL主从复制之进阶延时同步、GTID复制、半同步复制完整实验流程
android·mysql·adb
独行soc5 天前
2025年渗透测试面试题总结-42(题目+回答)
android·数据库·安全·adb·面试·渗透测试·sqlite
高级测试工程师欧阳5 天前
Mac上如何安装mysql
mysql·adb