使用adb shell dumpsys获取包名和分辨率

来源:互联网 发布:java 枚举接口 编辑:程序博客网 时间:2024/05/01 23:49

获取当前Activity的信息:

adb shell dumpsys activity | grep mFocusedActivity


打开要查看的应用包名:

$ adb shell dumpsys activity top | head -n 10
TASK com.ss.android.article.news id=382
ACTIVITY com.ss.android.article.news/.activity.MainActivity 92f8069 pid=4742
Local FragmentActivity 9db9ba9 State:
mCreated=truemResumed=true mStopped=false mReallyStopped=false
mLoadersStarted=true
Active Fragments in 564e38:
#0: r{4df2ea0 #0 id=0x7f100061 android:switcher:2131755105:cate_news_hot}
mFragmentId=#7f100061 mContainerId=#7f100061 mTag=android:switcher:2131755105:cate_news_hot
mState=5 mIndex=0 mWho=android:fragment:0 mBackStackNesting=0
mAdded=true mRemoving=false mFromLayout=false mInLayout=false


获取手机分辨率:

$adb shell dumpsys window | grep “ShownFrame” | head -n 1
mHasSurface=true mShowFrame=[0.0,0.0] [720.0,1280.0]

0 0
原创粉丝点击