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

    xiaoxiao2026-05-08  2

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

    转载请注明原文地址: https://ju.6miu.com/read-1309470.html
    最新回复(0)