I need a way to detect device screen size and density with adb. If there is no solution, where can I get the complete list of all existing android device with their screen size and density ?
You can also access the WindowManager through ADB:
$ adb shell wm
usage: wm [subcommand] [options]
wm size [reset|WxH]
wm density [reset|DENSITY]
wm overscan [reset|LEFT,TOP,RIGHT,BOTTOM]
To get the screen resolution:
$ adb shell wm size
Physical size: 2880x1600
To get the screen the density:
$ adb shell wm density
Physical density: 320
You can also override the density by adding the new density:
$ adb shell wm density 160