Android adb获取屏幕分辨率

获取Android设备屏幕分辨率,可以采用最快捷的方式,使用ADB命令获取即可:


打印详细方式:

adb shell dumpsys window displays

执行结果:

Dump time : 2016骞?2鏈?0鏃?涓婂崍10:43:00

WINDOW MANAGER DISPLAY CONTENTS (dumpsys window displays)

Display: mDisplayId=0

init=960x540 240dpi cur=960x540 app=897x540 rng=540x502-897x850

deferred=false layoutNeeded=false

mStacks[0]0

mStackId=0

mDeferDetach=false

{taskId=1 appTokens=[AppWindowToken{2ecaa7ab token=Token{1ee8c5fa ActivityRecord{19b44025 u0 com.eques.device/.ui.EquesActivity t1}}}] mdr=false}

Application tokens in top down Z order:

mStackId=0

mTaskId=1

Activity #0 AppWindowToken{2ecaa7ab token=Token{1ee8c5fa ActivityRecord{19b44025 u0 com.eques.device/.ui.EquesActivity t1}}}:

windows=[Window{27b28b14 u0 com.eques.device/com.eques.device.ui.EquesActivity}]

windowType=2 hidden=false hasVisible=true

app=true voiceInteraction=false

allAppWindows=[Window{27b28b14 u0 com.eques.device/com.eques.device.ui.EquesActivity}]

groupId=1 appFullscreen=true requestedOrientation=0

hiddenRequested=false clientHidden=false willBeHidden=false reportedDrawn=true reportedVisible=true

numInterestingWindows=1 numDrawnWindows=1 inPendingTransaction=false allDrawn=true (animator=true)

startingData=null removed=false firstWindowDrawn=true mDeferRemoval=false

示例:

Android adb获取屏幕分辨率


打印简单方式:

adb shell wm size

示例:

Android adb获取屏幕分辨率


谢谢大家的观看,更多精彩技术博客,会不断的更新,请大家访问,

刘德利CSDN博客, http://blog.csdn.net/u011967006

上一篇:获取json对象的长度


下一篇:Linux系统学习笔记(1)