使用如下命令获得Android手机屏幕分辨率
- 命令
adb shell dumpsys window displays
输出示例:
C:\Users\Administrator>adb shell dumpsys window displays
WINDOW MANAGER DISPLAY CONTENTS (dumpsys window displays)
mLastOrientationSource=DefaultTaskDisplayArea@157861498
Display: mDisplayId=0 stacks=3
init=1080x2340 480dpi cur=1080x2340 app=1080x2340 rng=1080x984-2340x2244
deferred=false mLayoutNeeded=false mTouchExcludeRegion=SkRegion((0,0,1080,2340))
(还有非常多信息)
- 增加筛选
adb shell dumpsys window displays | findstr app=
输出示例
C:\Users\Administrator>adb shell dumpsys window displays | findstr app=
init=1080x2340 480dpi cur=1080x2340 app=1080x2340 rng=1080x984-2340x2244
- 保存为脚本方便下次使用
@echo off
adb shell dumpsys window displays | findstr app=
echo.
echo.
pause
网友评论