wm命令可以用于获取屏幕分辨率、像素密度等。
前提:Android4.3及以上
usage: wm [subcommand] [options]
wm size [reset|WxH]
wm density [reset|DENSITY]
wm overscan [reset|LEFT,TOP,RIGHT,BOTTOM]
wm size: return or override display size.
wm density: override display density.
wm overscan: set overscan area for display.
获取屏幕尺寸:
adb shell wm size