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>
相关推荐
五五六六05243 小时前
adb server is out of date. killing...问题的解决
网络安全·adb
蜗牛、Z5 小时前
Android 日常开发Adb常用命令附档
android·adb
天下·第二1 天前
达梦数据库适配
android·数据库·adb
感谢地心引力1 天前
【Android】Shizuku 加 SystemUI Tuner 实现手机状态栏特定图标隐藏(小米 Hyper OS 3为例)
android·adb·智能手机·调试·hyper os·shizuku
搬砖的工人2 天前
记录一次windows 安装 mysq过程
android·windows·adb
_F_y2 天前
MySQL用户管理
android·mysql·adb
定偶2 天前
C语言操作MYSQL
c语言·mysql·adb
一池秋_2 天前
aarch64_Ubuntu (Linux)连不上adb解决方法
linux·ubuntu·adb
深念Y3 天前
中兴微随身WiFi 板号UZ901_v1.6 影腾Y1新版本 增加SIM卡槽 开启ADB 去云控 改串号教程 下
数据库·adb
yantaohk3 天前
【2025亲测】中兴B860AV3.2M完美刷机包ATV版本安卓9-解决1G运存BUG,开ADB已ROOT
android·嵌入式硬件·adb·云计算