A very useful command:
ADB shell Dumpsys Activity
This command can see which activity is currently running, some processes that are running, etc.
You can see the running process first:
Activity MANAGER RUNNING PROCESSES (dumpsys activity PROCESSES) Process LRU list (sorted by Oom_adj, all, non-act at 1, Non-svc at 1): PERS #42: Sys f//P trm:0 804:system/1000 (fixed) PERS #41: PERS f//P trm:0 914:com.andro ID.KEYGUARD/U0A8 (fixed) PERS #40: PERS f//P trm:0 960:com.android.systemui/u0a8 (fixed) PERS #39: PERS f//P trm:0 1133:com.android.phone/1001 (fixed) PERS #38: PERS f//P trm:0 1146:com.mediatek.voicecommand/u0a77 (fixed) PERS #37: PERS f//P trm:0 1159:com.huaqin.msa/1000 (fixed) PERS #36: PERS f//P trm:0 1173:com.cooee.widget.sa mweatherclock/u0a79 (fixed) PERS #35: PERS f//P trm:0 1188:com.mediatek.bluetooth/1002 (fixed) PERS #34: PERS F /P trm:0 1201:com.mediatek.voiceextension/1000 (fixed) PERS #33: PERS f//P trm:0 1216:com.coco.lock2.local.app. Cyclelibgdx/u0a45 (fixed) PERS #32: PERS f//P trm:0 1229:com.cooee.uni.allwidget/u0a73 (fixed) PERS #31: PERS F /P trm:0 1244:com.coCo.lock2.local.app.valentine/u0a74 (fixed) Proc #30: Fore f/a/t trm:0 1257:com.cooee.unilauncher.desktop/u0a2 (top-a ctivity) Proc # 7:vis f//if trm:0 1350:android.process.media/u0a6 (provider) COM.ANDROID.PROVIDERS.MEDIA/.M Ediaprovider<=proc{1530:com.android.music/u0a55} Proc # 0:vis f//if trm:0 1530:com.android.music/u0a55 (service ) com.android.music/. MEDIAPLAYBACKSERVICE<=PROC{1257:COM.COOEE.UNILAUNCHER.DESKTOP/U0A2} Proc #29: PRCP f//IF trm:0 1090:com.iflytek.i Nputmethod/u0a83 (Service) com.iflytek.inputmethod/. flyime<=proc{804:system/1000} Proc #14: PRCP f/s/if trm:0 1599:com.mediatek.mtklogger/u0a54 (fg-service) Proc # 25:svc b/S trm:0 2514:com.android.system/1000 (started-services) Proc # 5:svc b/S trm:0 1731:com.tencent. Mobileqq:msf/u0a96 (started-services) Proc # 2:svc b/S trm:0 2782:com.android.system:remote/1000 (service) Com.android.system/com.baidu.location.f<=proc{2514:com. android.system/1000} Proc # 1:svc b/S trm:0 2160:com.huaqin.festivalwallpaper/u0a36 (started-services) Proc #28: SVCB b/S trm:0 1542:com.android.gallery3d/u0a41 (started-services) Proc #27: SVCB b/S trm:0 2028:com.med iatek.atci.service/1000 (started-services) Proc #26: SVCB b/S trm:0 2368:org.simalliance.openmobileapi.service:rem Ote/u0a67 (started-services) Proc #13: SVCB b/S trm:0 2722:com.android.factoryservice/1000 (started-services) P ROC # 8:SVCB B/S trm:0 1957:com.tencent.mm:push/u0a95 (started-services) Proc # 6:SVCB b/S trm:0 2659:com.t Encent.mm/u0a95 (started-services) Proc # 4:CCH b//ce trm:0 2620:com.android.providers.calendar/u0a1 (cch-empty) Proc # 3:CCH b//ce trm:0 2764:android.process.acore/u0a3 (cch-empty) Proc #10: cch+2 b//ce trm:0 2067:com.andr OID.CALENDAR/U0A20 (Cch-empty) Proc # 9:cch+2 b//ce trm:0 2737:com.android.email/u0a34 (cch-empty) Proc #12: cch+ 4 b//ce trm:0 2404:com. ANDROID.CONTACTS/U0A3 (Cch-empty) Proc #11: cch+4 b//ce trm:0 2607:com.android.deskclock/u0a29 (cch-empty) Proc # 24:cch+6 b//ce trm:0 2532:com.adups.fota/u0a39 (cch-empty) Proc #23: cch+6 b//ce trm:0 2206:com.adups.fota.sysoper /1000 (cch-empty) Proc #22: cch+6 b//ce trm:0 2301:com.iloong.base.themebox/u0a60 (cch-empty) Proc #21: cch+6 b/ CE trm:0 2331:com.mediatek.schpwronoff/1000 (cch-empty) Proc #20: cch+6 b//ce trm:0 2640:com.android.musicfx/u0a56 ( Cch-empty) Proc #19: cch+6 b//ce trm:0 2460:com.android.mms/u0a9 (cch-empty) Proc #18: cch+6 b//ce trm:0 2387:co m.mediatek.ppl/1000 (cch-empty) Proc #17: cch+6 b//ce trm:0 2435:com.mediatek.op01.plugin/1000 (cch-empty) Proc #1 6:cch+6 b//ce trm:0 2237:com.mediatek.mediatekdm/1000 (cch-empty) Proc #15: cch+6 b//ce trm:0 2705:com.android.qui Cksearchbox/u0a65 (Cch-empty)
The final message is information that you can see on the activity stack:
Running activities (most recent first): taskrecord{42dde978 #3 a=android.task.mms u=0 sz=1} Run #2: Activityrecord{42ddcd78 u0 Com.android.mms/.ui. conversationlist T3} taskrecord{4287d4b0 #5 a=com.android.settings u=0 sz=1} Run #1: activityrecord{424d0798 U0 com.android.settings/. Settings T5} taskrecord{427e5990 #6 a=com.android.camera u=0 sz=1} Run #0: activityrecord{4270b068 u0 Com.android.gallery3d/com.android.camera.cameralauncher T6} mresumedactivity:activityrecord{42ddcd78 u0 Com.android.mms/.ui. conversationlist T3} mfocusedactivity:activityrecord{42ddcd78 u0 com.android.mms/.ui. conversationlist T3}
See which activity is currently being resume:
ADB Shell Dumpsys Activity | grep mfocusedactivity
After running, you can see that the activity that my phone is currently running is:
Mfocusedactivity:activityrecord{42ddcd78 u0 Com.android.mms/.ui. conversationlist T3}
Conversationlist.java interface, which is the interface of the short message list.
Android uses ADB to get activity stack information