Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
up vote 7 down vote accepted

the result and precise format of the dumpsys command depends on the hardware vendor (of graphics chipset/driver and handset itself) but you should be able to find that info in the adb shell dumpsys display output

share|improve this answer
So I could call adb shell dumpsys display | grep mBaseDisplayInfo to get the appropriate information? It seems to match up, on my nexus 7 dumpsys reports the density to be 213 and the resolution to be 800x1280. 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:… – Ehtesh Choudhury Apr 26 '13 at 20:14
yes. the problem is that different phones could have a different format of this line – user23414 Apr 26 '13 at 20:16

If display service isn't available in dumpsys, you may look for line ro.sf.lcd_density= into /system/build.prop. To get it from phone:

adb pull /system/build.prop
share|improve this answer

In Android versions equipped with wm tool, you can use the commands:

adb shell wm size # shows the real size and current size

adb shell wm density # shows the real density and current density

(Click image to enlarge)


I've tested successfully on stock Android 5.x and 6.x. Since wm tool comes with Android 4.3.x and 4.4.x as well, the solution may work on them as well.

share|improve this answer
Note: yes, the question restricts to now archaic Android version but the problem seems relevant for just any Android version. I decided to bring information not covered in accepted answer. – Firelord May 13 at 6:20

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.