adb shell dumpsys activity top

版权声明:本文为博主原创文章,未经博主允许不得转载的哦=。= https://blog.csdn.net/qq_15602635/article/details/86629595

在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)

没有更多推荐了,返回首页