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

获取当前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]

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值