概述
1、获取所用应用
adb shell dumpsys activity
2、获取自己的应用
adb shell dumpsys activity | grep com.xxx.xxx.xx
3、获取处于栈顶的activity
adb shell dumpsys activity | grep mFocusedActivity
4、解读堆栈信息:
shell@dior:/ $ dumpsys activity | grep com.hexin.android.bank
dumpsys activity | grep com.hexin.android.bank
* PendingIntentRecord{42b39700 com.hexin.android.bank broadcastIntent}
* PendingIntentRecord{42a1a2c8 com.hexin.android.bank startActivity}
-> 21438:com.hexin.android.bank/u0a99 s1/1 u0/0 +26m22s774ms
* ServiceRecord{4239f548 u0 com.hexin.android.bank/com.hexin.android.pushservice.PushService}
TaskRecord{42f4f138 #88 A=com.hexin.android.bank U=0 sz=3}
Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000
cmp=com.hexin.android.bank/.LogoActivity }
Hist #2: ActivityRecord{41f41018 u0 com.hexin.android.bank/.ifund.activity.LcbHelpActivity t
88}
Intent { cmp=com.hexin.android.bank/.ifund.activity.LcbHelpActivity }
ProcessRecord{4227b458 21438:com.hexin.android.bank/u0a99}
Hist #1: ActivityRecord{432a7698 u0 com.hexin.android.bank/.ifund.activity.LcbActivity t88}
Intent { cmp=com.hexin.android.bank/.ifund.activity.LcbActivity }
ProcessRecord{4227b458 21438:com.hexin.android.bank/u0a99}
Hist #0: ActivityRecord{41f9ffc0 u0 com.hexin.android.bank/.ifund.activity.IFundTabActivity
t88}
Intent { cmp=com.hexin.android.bank/.ifund.activity.IFundTabActivity }
ProcessRecord{4227b458 21438:com.hexin.android.bank/u0a99}
TaskRecord{42f4f138 #88 A=com.hexin.android.bank U=0 sz=3}
Run #6: ActivityRecord{41f41018 u0 com.hexin.android.bank/.ifund.activity.LcbHelpActivity t8
8}
Run #5: ActivityRecord{432a7698 u0 com.hexin.android.bank/.ifund.activity.LcbActivity t88}
Run #4: ActivityRecord{41f9ffc0 u0 com.hexin.android.bank/.ifund.activity.IFundTabActivity t
88}
mResumedActivity: ActivityRecord{41f41018 u0 com.hexin.android.bank/.ifund.activity.LcbHelpActiv
ity t88}
mFocusedActivity: ActivityRecord{41f41018 u0 com.hexin.android.bank/.ifund.activity.LcbHelpActivit
y t88}
* Recent #0: TaskRecord{42f4f138 #88 A=com.hexin.android.bank U=0 sz=3}
Proc # 0: fore F/A/T trm: 0 21438:com.hexin.android.bank/u0a99 (top-activity)
mPreviousProcess: ProcessRecord{4227b458 21438:com.hexin.android.bank/u0a99}
图中的红色代表 有三个acitivity,其他信息自己解读吧
最后
以上就是震动外套为你收集整理的Android使用adb获得当前应用 activity堆栈信息的全部内容,希望文章能够帮你解决Android使用adb获得当前应用 activity堆栈信息所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复