I've got adb access to my android phone.
So I know that I can override screen density and screen resolution with the am command provided with Android. That's great and dandy, I guess. But is there a way to grab those two numbers from the command line? I know the pm utility can do some information gathering, most notably pm list features to see if the Android device has wireless, bluetooth, gps, etc. pm doesn't seem to do much more information reporting than this, though.
It would be helpful to know what versions of Android that the command is supported for. Ideally I would like something that works on Android 2.2+ (Froyo), but taking something that only works from 4.0.3+ (Ice Cream Sandwich) is fine too. I would also like it if there was a way to figure this out without root access.
I know that it's possible to get the screen resolution and density programmatically, as described in this question.

adb shell dumpsys display | grep mBaseDisplayInfoto get the appropriate information? It seems to match up, on my nexus 7dumpsysreports the density to be213and the resolution to be800x1280. It also reports information on rotation and such, neat. I didn't know dumpsys existed, but it seems to report on a lot of useful information as noted here: http://stackoverflow.com/questions/11201659/android-adb-shell-dumpsys-tool – Ehtesh Choudhury Apr 26 '13 at 20:14