adb命令查看当前运行activity

使用adb命令查看最上层activity:

方法一 :

 在cmd命令中输入:adb shell dumpsys activity activities

 查看    * Hist #1: ActivityRecord{76f895b u0 com.hardwaremanager/.activity.SystemInfoActivity t39}
          packageName=com.hardwaremanager processName=com.hardwaremanager
          launchedFromUid=1000 launchedFromPackage=com.hardwaremanager userId=0
          app=ProcessRecord{adb308c 11225:com.hardwaremanager/1000}
          Intent { cmp=com.hardwaremanager/.activity.SystemInfoActivity }
          frontOfTask=false task=TaskRecord{e4f3bde #39 A=com.hardwaremanager U=
0 sz=2}
          taskAffinity=com.hardwaremanager
          realActivity=com.hardwaremanager/.activity.SystemInfoActivity
          baseDir=/system/app/LzyHardWareManager/LzyHardWareManager.apk
          dataDir=/data/user/0/com.hardwaremanager

其中 com.hardwaremanager为包名,.activity.SystemInfoActivity为当前activity名,

而且我们还可以看到一些其他信息,

 

方法二 :

在cmd命令中输入adb shell dumpsys activity | findstr "mFocusedActivity"

查看     mFocusedActivity: ActivityRecord{76f895b u0 com.hardwaremanager/.activity.SystemInfoActivity

其中 com.hardwaremanager为包名 ,SystemInfoActivity 为当前activity名

 

你可能感兴趣的:(adb)