Android adb獲取屏幕分辨率
1.
C:\Users\sheng>adb shell dumpsys window displays
WINDOW MANAGER DISPLAY CONTENTS (dumpsys window displays)
? Display: mDisplayId=0
? ? init=720x1440 320dpi cur=720x1440 app=720x1344 rng=720x672-1344x1296
? ? deferred=false mLayoutNeeded=false mTouchExcludeRegion=SkRegion((0,0,720,1440))
? Application tokens in top down Z order:
? ? mStackId=0
? ? mDeferRemoval=false
? ? mFillsParent=true
? ? mBounds=[0,0][720,1440]
? ? ? taskId=5
? ? ? ? mFillsParent=true
? ? ? ? mBounds=[0,0][720,1440]
? ? ? ? mdr=false
? ? ? ? appTokens=[AppWindowToken{c65d283 token=Token{38cf532 ActivityRecord{54b493d u0 com.android.launcher3/.Launcher t5}}}]
? ? ? ? mTempInsetBounds=[0,0][0,0]
? ? ? ? ? Activity #0 AppWindowToken{c65d283 token=Token{38cf532 ActivityRecord{54b493d u0 com.android.launcher3/.Launcher t5}}}
? ? ? ? ? windows=[Window{811af88 u0 com.android.launcher3/com.android.launcher3.Launcher}]
? ? ? ? ? windowType=2 hidden=false hasVisible=true
? ? ? ? ? app=true mVoiceInteraction=false
? ? ? ? ? task={taskId=5 appTokens=[AppWindowToken{c65d283 token=Token{38cf532 ActivityRecord{54b493d u0 com.android.launcher3/.Launcher t5}}}] mdr=false}
? ? ? ? ? mFillsParent=true mOrientation=-1
? ? ? ? ? hiddenRequested=false mClientHidden=false reportedDrawn=true reportedVisible=true
? ? ? ? ? mNumInterestingWindows=1 mNumDrawnWindows=1 inPendingTransaction=false allDrawn=true (animator=true)
? ? ? ? ? startingData=null removed=false firstWindowDrawn=true mIsExiting=false
? ? ? ? ? controller=AppWindowContainerController{ token=Token{38cf532 ActivityRecord{54b493d u0 com.android.launcher3/.Launcher t5}} mContainer=AppWindowToken{c65d283 token=Token{38cf532 ActivityRecord{54b493d u0 com.android.launcher3/.Launcher t5}}} mListener=ActivityRecord{54b493d u0 com.android.launcher3/.Launcher t5}}
? ? mStackId=1
? ? mDeferRemoval=false
? ? mFillsParent=true
? ? mBounds=[0,0][720,1440]
? ? ? taskId=8
? ? ? ? mFillsParent=true
? ? ? ? mBounds=[0,0][720,1440]
? ? ? ? mdr=false
? ? ? ? appTokens=[AppWindowToken{59db3c4 token=Token{8587ed7 ActivityRecord{f300e56 u0 com.android.launcher3/.SettingsActivity t8}}}]
? ? ? ? mTempInsetBounds=[0,0][0,0]
? ? ? ? ? Activity #0 AppWindowToken{59db3c4 token=Token{8587ed7 ActivityRecord{f300e56 u0 com.android.launcher3/.SettingsActivity t8}}}
? ? ? ? ? windows=[Window{f89f219 u0 com.android.launcher3/com.android.launcher3.SettingsActivity}]
? ? ? ? ? windowType=2 hidden=true hasVisible=true
? ? ? ? ? app=true mVoiceInteraction=false
? ? ? ? ? task={taskId=8 appTokens=[AppWindowToken{59db3c4 token=Token{8587ed7 ActivityRecord{f300e56 u0 com.android.launcher3/.SettingsActivity t8}}}] mdr=false}
? ? ? ? ? mFillsParent=true mOrientation=-1
? ? ? ? ? hiddenRequested=true mClientHidden=true reportedDrawn=false reportedVisible=false
? ? ? ? ? mAppStopped=true
? ? ? ? ? mNumInterestingWindows=1 mNumDrawnWindows=1 inPendingTransaction=false allDrawn=true (animator=true)
? ? ? ? ? startingData=null removed=false firstWindowDrawn=true mIsExiting=false
? ? ? ? ? controller=AppWindowContainerController{ token=Token{8587ed7 ActivityRecord{f300e56 u0 com.android.launcher3/.SettingsActivity t8}} mContainer=AppWindowToken{59db3c4 token=Token{8587ed7 ActivityRecord{f300e56 u0 com.android.launcher3/.SettingsActivity t8}}} mListener=ActivityRecord{f300e56 u0 com.android.launcher3/.SettingsActivity t8}}
? ? ? taskId=7
? ? ? ? mFillsParent=true
? ? ? ? mBounds=[0,0][720,1440]
? ? ? ? mdr=false
? ? ? ? appTokens=[AppWindowToken{99f5b0 token=Token{9ee24f3 ActivityRecord{f24b62 u0 com.android.settings/.Settings t7}}}, AppWindowToken{86a682a token=Token{e6b4d15 ActivityRecord{6bc56cc u0 com.android.settings/.Settings$DisplaySettingsActivity t7}}}]
? ? ? ? mTempInsetBounds=[0,0][0,0]
? ? ? ? ? Activity #1 AppWindowToken{86a682a token=Token{e6b4d15 ActivityRecord{6bc56cc u0 com.android.settings/.Settings$DisplaySettingsActivity t7}}}
? ? ? ? ? windows=[Window{7e06d93 u0 com.android.settings/com.android.settings.Settings$DisplaySettingsActivity}]
? ? ? ? ? windowType=2 hidden=true hasVisible=true
? ? ? ? ? app=true mVoiceInteraction=false
? ? ? ? ? task={taskId=7 appTokens=[AppWindowToken{99f5b0 token=Token{9ee24f3 ActivityRecord{f24b62 u0 com.android.settings/.Settings t7}}}, AppWindowToken{86a682a token=Token{e6b4d15 ActivityRecord{6bc56cc u0 com.android.settings/.Settings$DisplaySettingsActivity t7}}}] mdr=false}
? ? ? ? ? mFillsParent=true mOrientation=-1
? ? ? ? ? hiddenRequested=true mClientHidden=true reportedDrawn=false reportedVisible=false
? ? ? ? ? mAppStopped=true
? ? ? ? ? mNumInterestingWindows=1 mNumDrawnWindows=1 inPendingTransaction=false allDrawn=true (animator=true)
? ? ? ? ? startingData=null removed=false firstWindowDrawn=true mIsExiting=false
? ? ? ? ? controller=AppWindowContainerController{ token=Token{e6b4d15 ActivityRecord{6bc56cc u0 com.android.settings/.Settings$DisplaySettingsActivity t7}} mContainer=AppWindowToken{86a682a token=Token{e6b4d15 ActivityRecord{6bc56cc u0 com.android.settings/.Settings$DisplaySettingsActivity t7}}} mListener=ActivityRecord{6bc56cc u0 com.android.settings/.Settings$DisplaySettingsActivity t7}}
? ? ? ? ? Activity #0 AppWindowToken{99f5b0 token=Token{9ee24f3 ActivityRecord{f24b62 u0 com.android.settings/.Settings t7}}}
? ? ? ? ? windows=[Window{4c30d2f u0 com.android.settings/com.android.settings.Settings}]
? ? ? ? ? windowType=2 hidden=true hasVisible=true
? ? ? ? ? app=true mVoiceInteraction=false
? ? ? ? ? task={taskId=7 appTokens=[AppWindowToken{99f5b0 token=Token{9ee24f3 ActivityRecord{f24b62 u0 com.android.settings/.Settings t7}}}, AppWindowToken{86a682a token=Token{e6b4d15 ActivityRecord{6bc56cc u0 com.android.settings/.Settings$DisplaySettingsActivity t7}}}] mdr=false}
? ? ? ? ? mFillsParent=true mOrientation=-1
? ? ? ? ? hiddenRequested=true mClientHidden=true reportedDrawn=false reportedVisible=false
? ? ? ? ? mAppStopped=true
? ? ? ? ? mNumInterestingWindows=1 mNumDrawnWindows=1 inPendingTransaction=false allDrawn=true (animator=true)
? ? ? ? ? startingData=null removed=false firstWindowDrawn=true mIsExiting=false
? ? ? ? ? controller=AppWindowContainerController{ token=Token{9ee24f3 ActivityRecord{f24b62 u0 com.android.settings/.Settings t7}} mContainer=AppWindowToken{99f5b0 token=Token{9ee24f3 ActivityRecord{f24b62 u0 com.android.settings/.Settings t7}}} mListener=ActivityRecord{f24b62 u0 com.android.settings/.Settings t7}}
? DimLayerController
? ? Task=5
? ? ? dimLayer=shared, animator=null, continueDimming=false
? ? ? mDimSurface=Surface(name=DimLayerController/Stack=0) mLayer=110999 mAlpha=0.0
? ? ? mLastBounds=[-180,-360][900,1800] mBounds=[-180,-360][900,1800]
? ? ? Last animation:? mDuration=200 mStartTime=9358231 curTime=13484603
? ? ? mStartAlpha=0.6 mTargetAlpha=0.0
? ? Stack=1
? ? ? dimLayer=shared, animator=null, continueDimming=false
? ? ? mDimSurface=Surface(name=DimLayerController/Stack=0) mLayer=110999 mAlpha=0.0
? ? ? mLastBounds=[-180,-360][900,1800] mBounds=[-180,-360][900,1800]
? ? ? Last animation:? mDuration=200 mStartTime=9358231 curTime=13484603
? ? ? mStartAlpha=0.6 mTargetAlpha=0.0
? ? Task=8
? ? ? dimLayer=shared, animator=null, continueDimming=false
? ? ? mDimSurface=Surface(name=DimLayerController/Stack=0) mLayer=110999 mAlpha=0.0
? ? ? mLastBounds=[-180,-360][900,1800] mBounds=[-180,-360][900,1800]
? ? ? Last animation:? mDuration=200 mStartTime=9358231 curTime=13484604
? ? ? mStartAlpha=0.6 mTargetAlpha=0.0
? ? Task=7
? ? ? dimLayer=shared, animator=null, continueDimming=false
? ? ? mDimSurface=Surface(name=DimLayerController/Stack=0) mLayer=110999 mAlpha=0.0
? ? ? mLastBounds=[-180,-360][900,1800] mBounds=[-180,-360][900,1800]
? ? ? Last animation:? mDuration=200 mStartTime=9358231 curTime=13484604
? ? ? mStartAlpha=0.6 mTargetAlpha=0.0
? ? Stack=0
? ? ? dimLayer=shared, animator=null, continueDimming=false
? ? ? mDimSurface=Surface(name=DimLayerController/Stack=0) mLayer=110999 mAlpha=0.0
? ? ? mLastBounds=[-180,-360][900,1800] mBounds=[-180,-360][900,1800]
? ? ? Last animation:? mDuration=200 mStartTime=9358231 curTime=13484604
? ? ? mStartAlpha=0.6 mTargetAlpha=0.0
? DockedStackDividerController
? ? mLastVisibility=false
? ? mMinimizedDock=false
? ? mAdjustedForIme=false
? ? mAdjustedForDivider=false
? PinnedStackController
? ? defaultBounds=[304,1096][688,1312]
? ? movementBounds=[32,80][688,1312]
? ? mIsImeShowing=false
? ? mIsMinimized=false
? ? mActions=[]
C:\Users\wangxiaosheng>
2:adb shell wm size
Physical size: 720x1440