Android dumpsys活动| grep-我运行未列出活动
adb dumpsys活动| grep-我运行未列出运行活动。它显示以下输出Android dumpsys活动| grep-我运行未列出活动,android,android-activity,adb,dumpsys,Android,Android Activity,Adb,Dumpsys,adb dumpsys活动| grep-我运行未列出运行活动。它显示以下输出 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
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:/ $
问题在于设备早期工作正常,但在我更新后,它会显示这些输出。当我运行$adb shell dumpsys activity时| grep-我在pixel 8 Api 30 emulator上运行,得到的正是您在第一次输出中得到的结果,比如“在+3m7s564ms上运行cpu时使用了0%(0%) 当我在没有grep的情况下运行adb shell dumpsys活动时,只获得了恢复的和集中的活动。未获得运行活动 当我运行adb shell dumpsys activity activities | grep-我使用grep运行时,我的提示符上没有任何内容。因为run没有任何内容 但当我在实际设备上运行相同的命令时,adb shell dumpsys activities | grep-我在实际设备上运行的命令低于输出 因此,请使用adb shell dumpsys activities | grep-i run命令和设备。尝试在不同的设备上运行,或者如果您最近更新了android studio,请创建新的emulator并在其上运行
您希望看到什么
grep
输出与提供的正则表达式匹配的所有行。在您的例子中,正则表达式是run
,而-i
使检查不区分大小写。因此,grep-i run
的输出将是输入的所有行,其中包含run
,小写、大写或混合大写。在抽查中,您输出的所有行中都包含run
(例如,mMaxRunningUsers
包含run
)。我已更新了我想要查看的问题。Grep正在按您所说的那样工作。两个输出是否来自同一个设备?如果没有,可能有一台设备没有输出预期结果。第一台似乎是三星,而第二台是小米红米…是的,第一台是三星的,第二台是小米红米的,adb shell dumpsys活动仍在进行中,我没有得到渴望的输出。更新@AmitYadavI在Redmi设备上也获得了所需的输出问题是SamsungSupery@AmitYadavIf如果它是真正的设备,它应该可以工作。请仔细检查您的adb命令,因为您在问题中仅在命令中发布了活动,使用该命令时无法获取运行活动,请确保在运行命令时已打开应用[单击“最近”按钮时至少打开一个最近的应用]。