美文网首页
如何用adb shell dumpsys 使用

如何用adb shell dumpsys 使用

作者: gaoqi03 | 来源:发表于2019-01-23 11:03 被阅读51次

1 获取当前应用栈顶的activity

手机清除最近应用,打开微信,执行如下命令:

adb shell dumpsys activity | grep "mFocusedActivity" 

或者:

 adb shell dumpsys activity | grep -I run

获取当前应用栈顶activity 

可以看到,微信首页activity 为 LauncherUI.activity。

2  然后我们根据报名,获取微信所有的activity:

adb shell dumpsys activity -p  com.tencent.mm 

微信主页的activity信息

可以不仅可以看到微信主页 activity 的信息,还有 栈顶activity的View Hierarchy组成部分:

发现微信有大量的自定义view,但是整体深度并不是很深。包含的fragment 如下:

LuncherUI 包含的activity

当前主线程looper 中的message:

主线程中looper中的消息

3  adb shell dumpsys activity p com.tencent.mm 查看应用信息。

相关文章

网友评论

      本文标题:如何用adb shell dumpsys 使用

      本文链接:https://www.haomeiwen.com/subject/sxhrjqtx.html