0

adb dumpsys activity | grep -i run not listing running activity. It shows below output,

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:/ $

I want this output

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:/ $

Problem is with device it was working fine earlier but after I update it, it showing me those output.

Amit Yadav
  • 32,664
  • 6
  • 42
  • 57
  • What are you expecting to see? `grep` outputs all lines matching the supplied regular expression. In your case, the regular expression is `run`, and `-i` makes the check case-insensitive. So, the output of `grep -i run` will be all lines of the input with `run` in them, in lowercase, uppercase, or mixed case. In a spot check, all lines of your output contain `run` in them in one case or another (e.g., `mMaxRunningUsers` has `Run` in it). – CommonsWare May 28 '21 at 11:12
  • I have updated my question that what I want to see. Grep is working as it is as you told. – Amit Yadav May 28 '21 at 11:56
  • Are both outputs are from the same device? If not, maybe one device is not outputing the expected result. – TDG May 29 '21 at 09:09
  • the first one seems a Samsung whereas the second one a Xiaomi Redmi... – Lino May 29 '21 at 09:22
  • Yes first one is from Samsung and second one is from Xiaomi Redmi – Amit Yadav May 29 '21 at 09:54
  • So the problem is that your device is not giving you the expected output. Try to run `adb shell dumpsys > dump.txt` and search the entire dump file for your desired lines. If it's there - you can figure out in which part of the dump it is. If not - it's a lost case. – TDG May 29 '21 at 13:50
  • @TDG adb shell dumpsys > dump.txt Access is denied. is coming. – Amit Yadav May 31 '21 at 06:27

1 Answers1

0

when i run $ adb shell dumpsys activity | grep -i run on pixel 8 Api 30 emulator, got exactly what you got in your first output like "run cpu over +3m7s564ms used 0 (0%)".

when i run adb shell dumpsys activity activities without grep, got only resumed and focused activity.did not get running activity.

when i run adb shell dumpsys activity activities | grep -i run with grep, got nothing on my prompt.because there is nothing with run.

but when i run same command adb shell dumpsys activity activities | grep -i run on real device got below output.

so use adb shell dumpsys activity activities | grep -i run command and device is also the matter.try to run on different device or if you recently updated android studio,create new emulator and run on it.

enter image description here

androidLearner
  • 1,654
  • 1
  • 7
  • 13