0

adb dumpsys 活动 | grep -i run 不列出正在运行的活动。它显示下面的输出,

m11q:/ $ dumpsys activity | grep -i run   
service_reset_run_duration=60000
          -> 13014:com.sec.spp.push:remoteRuna/u0a63 s1/1 u0/0 +9m54s749ms   * ServiceRecord{d42721f u0 com.sec.spp.push/com.sec.spp.runa.service.RunaService}
        app=ProcessRecord{331c940 13014:com.sec.spp.push:remoteRuna/u0a63}
              process=com.sec.spp.push:remoteRuna System server and oomAdj runtimes (ms) in recent battery sessions (most recent first): System server total oomAdj runtimes (us) since boot: ACTIVITY MANAGER RUNNING PROCESSES (dumpsys activity processes)
            run cpu over +3m7s564ms used 0 (0%)
        Proc #37: svcb   b/ /SVC  ---  t: 0 13014:com.sec.spp.push:remoteRuna/u0a63 (started-services)
            run cpu over +3m7s564ms used 0 (0%)
            run cpu over +3m7s564ms used 0 (0%)
            run cpu over +3m7s564ms used 0 (0%)
            run cpu over +3m7s564ms used 0 (0%)
            run cpu over +3m7s564ms used 0 (0%)
          proc=ProcessRecord{331c940 13014:com.sec.spp.push:remoteRuna/u0a63}
        #20: svcb   SVC  --- 13014:com.sec.spp.push:remoteRuna/u0a63
        Proc #37: svcb   b/ /SVC  ---  t: 0 13014:com.sec.spp.push:remoteRuna/u0a63 (started-services)
        User #0: state=RUNNING_UNLOCKED   mMaxRunningUsers:4
        MinimizeContainerServiceBinder Running=false
        SmartPopupViewServiceBinder Running=false   isRemoteAppDisplayRunning=false m11q:/ $

我想要这个输出

whyred:/ $ dumpsys activity | grep -i run
  service_reset_run_duration=60000
  * ContentProviderRecord{5286ee9 u0 com.android.settings/.cloud.push.RunningCompatibilityProvider}
    authority=com.android.settings.cloud.compatibility.running
    Running activities (most recent first):
        Run #1: ActivityRecord{2aaf621 u0 com.idreams.project.onlinesatta/.ActivityWebView t1105}
        Run #0: ActivityRecord{6ad0faa u0 com.idreams.project.onlinesatta/.ActivityDashboard t1105}
    Running activities (most recent first):
        Run #0: ActivityRecord{d66f9fa u0 com.teslacoilsw.launcher/.NovaLauncher t529}
    Running activities (most recent first):
        Run #0: ActivityRecord{5bd6d49 u0 com.android.systemui/.recents.RecentsActivity t3}
    Running activities (most recent first):
        Run #1: ActivityRecord{f699f1e u0 com.idreams.project.onlinesatta/.ActivityDashboard t1105}
        Run #0: ActivityRecord{80cf218 u0 com.idreams.project.onlinesatta/.ActivityDashboard t1105}
    Running activities (most recent first):
        Run #0: ActivityRecord{d66f9fa u0 com.teslacoilsw.launcher/.NovaLauncher t529}
    Running activities (most recent first):
        Run #0: ActivityRecord{5bd6d49 u0 com.android.systemui/.recents.RecentsActivity t3}
ACTIVITY MANAGER RUNNING PROCESSES (dumpsys activity processes)
    User #0: state=RUNNING_UNLOCKED
    User #999: state=RUNNING_UNLOCKED
whyred:/ $

问题出在设备上,它早些时候工作正常,但在我更新它之后,它向我显示了这些输出。

4

1 回答 1

0

当我运行$ adb shell dumpsys 活动时 | grep -i在像素 8 Api 30 模拟器上运行,得到你在第一个输出中得到的结果,比如“运行 cpu over +3m7s564ms used 0 (0%)”。

当我在没有 grep 的情况下运行adb shell dumpsys 活动时,只能恢复和集中活动。没有运行活动。

当我运行adb shell dumpsys 活动时 | grep -i使用 grep 运行,提示符没有任何内容。因为运行没有任何内容。

但是当我运行相同的命令 adb shell dumpsys 活动活动 | grep -i在真实设备上运行得到低于输出。

所以使用adb shell dumpsys 活动活动| grep -i run命令和设备也是问题。尝试在不同的设备上运行,或者如果您最近更新了 android studio,创建新的模拟器并在其上运行。

在此处输入图像描述

于 2021-05-28T21:00:22.330 回答