在Android P的模拟器上执行adb shell dumpsys activity | grep "Focus"无法显示顶层的Activity。于是就想着换一个命令,结果发现了更强大的adb shell dumpsys activity top

功能:
0、可以显示当前的Activity
1、可以显示View Hierarchy,看view的类信息
2、可以显示Handler中的Message信息

打开支付宝时,执行命令如下:

Mac:~ portgas$ adb shell dumpsys activity top
TASK com.eg.android.AlipayGphone id=4868
ACTIVITY com.eg.android.AlipayGphone/com.alipay.mobile.security.login.ui.AlipayUserLoginActivity 2944402 pid=12548
Local Activity a1a6cde State:
mResumed=true mStopped=false mFinished=false
mChangingConfigurations=false
mCurrentConfig={1.0 ?mcc?mnc [zh_CN_#Hans] ldltr sw360dp w360dp h574dp 480dpi nrml port finger -keyb/v/h -nav/h suim:1 s.152}
mLoadersStarted=true
FragmentManager misc state:
mHost=android.app.Activity$HostCallbacks@3da084f
mContainer=android.app.Activity$HostCallbacks@3da084f
mCurState=5 mStateSaved=false mDestroyed=false
ViewRoot:
mAdded=true mRemoved=false
mConsumeBatchedInputScheduled=false
mConsumeBatchedInputImmediatelyScheduled=false
mPendingInputEventCount=0
mProcessInputEventsScheduled=false
mTraversalScheduled=false mIsAmbientMode=false
android.view.ViewRootImpl$NativePreImeInputStage: mQueueLength=0
android.view.ViewRootImpl$ImeInputStage: mQueueLength=0
android.view.ViewRootImpl$NativePostImeInputStage: mQueueLength=0
Choreographer:
mFrameScheduled=false
mLastFrameTime=202415001 (83065 ms ago)
View Hierarchy:
DecorView@e77cbdc[AlipayUserLoginActivity]
android.widget.LinearLayout{14704e5 V.E...... ........ 0,0-1080,1794}
android.view.ViewStub{cd90bba G.E...... ......I. 0,0-0,0 #10203e4 android:id/action_mode_bar_stub}
android.widget.FrameLayout{5d8da6b V.E...... ........ 0,72-1080,1794 #1020002 android:id/content}
android.widget.LinearLayout{9a3c9c8 V.E...... ........ 0,0-1080,1722}
android.widget.RelativeLayout{ae80a61 V.E...... ........ 0,0-1080,144}
android.widget.LinearLayout{ffc2986 V.E...... ........ 888,8-1080,136 #79080016 com.ali.user.mobile.security.ui:id/titleLayout}
android.widget.LinearLayout{6a8b247 V.E...C.. ........ 0,0-192,128}
android.widget.TextView{60fba74 V.ED..... ........ 0,0-192,128 #73080022 com.alipay.mobile.accountauthbiz:id/switchLanguage}
com.alipay.mobile.antui.basic.AUTitleBar{939eb9d G.E...... ......I. 0,0-0,0 #79080029 com.ali.user.mobile.security.ui:id/titleBar}
com.alipay.mobile.antui.basic.AURelativeLayout{be15812 V.E...... ......ID 0,0-0,0 #2f0a0018 com.alipay.mobile.antui:id/title_bar_kernel}
android.view.View{7b42be3 G.ED..... ......I. 0,0-0,0 #2f0a00f0 com.alipay.mobile.antui:id/title_bar_status_bar}
com.alipay.mobile.antui.basic.AULinearLayout{1a809e0 V.E...... ......I. 0,0-0,0 #2f0a0112 com.alipay.mobile.antui:id/title_bar_horizon}
com.alipay.mobile.antui.iconfont.AUIconView{acea499 V.E...C.. ......I. 0,0-0,0 #2f0a0113 com.alipay.mobile.antui:id/back_button}
com.alipay.mobile.antui.basic.AUTextView{778e35e V.ED..... ......ID 0,0-0,0}
com.alipay.mobile.antui.basic.AURelativeLayout{c73a33f V.E...... ......I. 0,0-0,0 #2f0a00aa com.alipay.mobile.antui:id/title_container}
com.alipay.mobile.antui.basic.AUTextView{ab3e40c V.ED..... ......I. 0,0-0,0 #2f0a0043 com.alipay.mobile.antui:id/title_text}
com.alipay.mobile.antui.basic.AUProgressBar{b5bf155 G.ED..... ......I. 0,0-0,0 #2f0a0114 com.alipay.mobile.antui:id/title_bar_progress}
com.alipay.mobile.antui.basic.AURelativeLayout{66bd76a G.E...... ......I. 0,0-0,0 #2f0a0115 com.alipay.mobile.antui:id/right_container_1}
com.alipay.mobile.antui.iconfont.AUIconView{d89345b V.E...... ......I. 0,0-0,0 #2f0a0116 com.alipay.mobile.antui:id/left_text}
android.view.View{ac134f8 V.ED..... ......I. 0,0-0,0}
com.alipay.mobile.antui.basic.AURelativeLayout{2374dd1 G.E...... ......I. 0,0-0,0 #2f0a0117 com.alipay.mobile.antui:id/right_container_2}
com.alipay.mobile.antui.iconfont.AUIconView{be80036 V.E...... ......I. 0,0-0,0 #2f0a0118 com.alipay.mobile.antui:id/right_text}
android.view.View{19cbb37 V.ED..... ......I. 0,0-0,0}
com.ali.user.mobile.util.ResizeScrollView{450a8a4 VFED..... ........ 0,144-1080,1722 #7908002a com.ali.user.mobile.security.ui:id/viewContainers}
com.ali.user.mobile.login.view.FaceLoginView{c91f60d V.E...... ........ 48,0-1032,1578}
android.widget.RelativeLayout{e2be9c2 V.E...... ........ 0,0-984,258}
com.alipay.mobile.antui.basic.AURoundImageView{1a7d658 V.ED..... ........ 387,48-597,258 #79080062 com.ali.user.mobile.security.ui:id/userAccountImage}
android.widget.TextView{7f7d3d3 G.ED..... ......I. 0,0-0,0 #79080038 com.ali.user.mobile.security.ui:id/mainTip}
android.widget.LinearLayout{f41ab10 V.E...... ........ 0,258-984,387}
android.widget.TextView{f74e609 V.ED..... ........ 0,48-984,129 #7908007e com.ali.user.mobile.security.ui:id/faceLoginUserAccount}
android.widget.RelativeLayout{6d2e00e V.E...... ........ 0,387-984,1578}
android.widget.RelativeLayout{e1da2f V.E...C.. ........ 0,120-984,264 #7908006e com.ali.user.mobile.security.ui:id/faceLoginButtonLayout}
android.widget.TextView{ffe683c V.ED..... ........ 390,38-594,106 #7908006f com.ali.user.mobile.security.ui:id/faceLoginButton}
android.widget.TextView{d7cd9c5 V.ED..C.. ........ 300,285-684,431 #79080070 com.ali.user.mobile.security.ui:id/switchToPasswordLogin}
android.widget.TextView{be0ef1a V.ED..C.. ........ 411,1003-573,1131 #79080071 com.ali.user.mobile.security.ui:id/more}
android.view.View{fbbea4b V.ED..... ........ 0,1794-1080,1920 #1020030 android:id/navigationBarBackground}
android.view.View{567cc28 V.ED..... ........ 0,0-1080,72 #102002f android:id/statusBarBackground}
Looper (main, tid 1) {c564d41}
Message 0: { when=+1m37s746ms what=0 target=com.alipay.android.phone.ThreadHandler$1 }
Message 1: { when=+1m37s747ms what=0 target=com.alipay.android.phone.ThreadHandler$1 }
Message 2: { when=+1m37s747ms what=0 target=com.alipay.android.phone.ThreadHandler$1 }
Message 3: { when=+1m37s747ms what=0 target=com.alipay.android.phone.ThreadHandler$1 }
Message 4: { when=+1m37s748ms what=0 target=com.alipay.android.phone.ThreadHandler$1 }
Message 5: { when=+1m37s748ms what=0 target=com.alipay.android.phone.ThreadHandler$1 }
Message 6: { when=+1m37s748ms what=0 target=com.alipay.android.phone.ThreadHandler$1 }
Message 7: { when=+1m37s762ms what=0 target=com.alipay.android.phone.ThreadHandler$1 }
Message 8: { when=+1m37s762ms what=0 target=com.alipay.android.phone.ThreadHandler$1 }
Message 9: { when=+1m37s772ms what=0 target=com.alipay.android.phone.ThreadHandler$1 }
Message 10: { when=+1m37s772ms what=0 target=com.alipay.android.phone.ThreadHandler$1 }
Message 11: { when=+1m37s772ms what=0 target=com.alipay.android.phone.ThreadHandler$1 }
Message 12: { when=+1m37s772ms what=0 target=com.alipay.android.phone.ThreadHandler$1 }
Message 13: { when=+1m37s772ms what=0 target=com.alipay.android.phone.ThreadHandler$1 }
Message 14: { when=+1m37s772ms what=0 target=com.alipay.android.phone.ThreadHandler$1 }
Message 15: { when=+1m37s853ms what=0 target=com.alipay.android.phone.ThreadHandler$1 }
Message 16: { when=+1m37s863ms what=0 target=com.alipay.android.phone.ThreadHandler$1 }
Message 17: { when=+1m37s864ms what=0 target=com.alipay.android.phone.ThreadHandler$1 }
Message 18: { when=+1m37s865ms what=0 target=com.alipay.android.phone.ThreadHandler$1 }
Message 19: { when=+1m37s865ms what=0 target=com.alipay.android.phone.ThreadHandler$1 }
Message 20: { when=+1m37s866ms what=0 target=com.alipay.android.phone.ThreadHandler$1 }
Message 21: { when=+1m37s867ms what=0 target=com.alipay.android.phone.ThreadHandler$1 }
Message 22: { when=+1m37s868ms what=0 target=com.alipay.android.phone.ThreadHandler$1 }
Message 23: { when=+3m58s475ms what=2 target=org.chromium.base.SystemMessageHandler }
(Total messages: 24, polling=false, quitting=false)

adb shell dumpsys activity top相关推荐

  1. adb shell dumpsys activity

    1 需求 查询当前运行activity adb shell dumpsys activity | findstr mFocusedApp adb shell dumpsys activity | fi ...

  2. 打印Activity任务栈脚本:adb shell dumpsys activity

    #!/bin/bash while [ 1 ] do echo"****************************<-----开始----->*************** ...

  3. Android adb shell dumpsys activity broadcasts分析

    adb shell dumpsys activity 中的broadcasts信息 通过adb shell dumpsys activity打印中的第二项就是broadcasts信息: ACTIVIT ...

  4. Android之adb shell dumpsys activity获取task里面的所有actitiy

    android 如何在开启一个activity的时候清除所有前面的Activity intent intent = new Intent();intent.addFlag(Intent.FLAG_AC ...

  5. adb shell dumpsys 使用命令和来源

    一.概述 adb shell dumpsys 在Android开发中经常要用到,平时都是零碎的积累,用到什么的时候就 记录下来,最近看了一些资料,发现可以汇总所有的命令,当带某个参数的时候,就可以查看 ...

  6. adb shell dumpsys package

    1 需求 获取手机中声明的所有权限 perm[issions]: dump permissions 获取手机中申请指定权限的所有应用 permission [name ...]: dump decla ...

  7. Android内存泄漏查找和解决adb shell dumpsys meminfo packagement

    1.通过adb shell dumpsys meminfo packageName来查看内存使用状况 在没有打开应用的情况下,该命令返回的数据是这样的: 2.打开这个应用的MainActivity,再 ...

  8. adb shell dumpsys简单介绍

    以下内容来自stack overflow上的一个提问,因为个人英语水平所限,就不翻译了,将主要内容整理如下,方便查阅.简而言之,介绍了如下内容 dumpsys可以用来检测系统的服务信息 列出dumps ...

  9. adb shell dumpsys 命令 查看内存

    android程序内存被分为2部分:native和dalvik,dalvik就是我们平常说的java堆,我们创建的对象是在这里面分配的,而bitmap是直接在native上分配的,对于内存的限制是 n ...

  10. 【转载】adb shell dumpsys 查看内存

    android程序内存被分为2部分:native和dalvik,dalvik就是我们平常说的java堆,我们创建的对象是在这里面分配的,而bitmap是直接在native上分配的,对于内存的限制是 n ...

最新文章

  1. 【转】Linux Oracle服务启动停止脚本与开机自启动
  2. struts2 用form取值时出现的错误
  3. 跨链Cosmos(1) 网络拓扑
  4. Divan and bitwise operations 异或,同或,组合数学(1500)
  5. 在项目中常用到的几个注解@JsonInclude、@JsonFormat、@DateTimeFormat
  6. Mybatis之占位符与拼接符
  7. 宏块帧内预测的具体过程
  8. BugkuCTF-MISC题telnet
  9. windows下JAVA环境变量配置
  10. 致产品经理:是时候要学学编程了!
  11. 名校课程、计算机相关课程等网站连接
  12. 新手如何Reverces(3自动化逆向篇)
  13. GAN(生成对抗神经网络)生成MNIST 基于pytorch实现
  14. 研究生从事学术研究的赫曼法则(The Laws of Herman)。
  15. TVDI中线性拟合干湿边的步骤
  16. android mvp mvvm ppt,Android中MVC MVP MVVM模式
  17. SQLI DUMB SERIES-2
  18. 建筑企业应采用电子招投标的10个理由
  19. CF1603B Moderate Modular Mode
  20. 娱乐网站(博主自用,他人勿扰)

热门文章

  1. 贝叶斯决策论(一):贝叶斯决策理论
  2. R数据分析:样本量计算的底层逻辑与实操,pwr包
  3. 泛函分析 04.04 有界线性算子 - 开映射定理与逆算子定理
  4. windows 无法安装到这个磁盘,选中的磁盘具有MBR分区表,在EFI系统上,windows只能安装在GPT磁盘上
  5. OFDM转向FBMC
  6. cnc计算机控制,CNC控制器
  7. WebService接口的生成和调用(WebService接口)
  8. 二阶滤波器matlab代码,双二阶滤波器之MATLAB设计及C语言实现
  9. D触发器的工作原理以及Verilog代码(一/二)
  10. python炫彩界面_炫彩界面库和火花脚本编辑框scintilla制作python IDE框架