How to get the Android device screen size from the adb command line?

前端 未结 9 1992
故里飘歌
故里飘歌 2020-12-07 10:37

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

9条回答
  •  再見小時候
    2020-12-07 11:13

    To get required info from ADB, the following command executed from the command line will return a lot of useful properties about the connected devices

    > adb shell getprop
    

    To filter through these properties

    on Unix use grep like

    > adb shell getprop | grep density
    

    on Windows use find like

    > adb shell getprop | findstr "density"
    

    Returned value looks like

    [ro.sf.lcd_density]: [240]
    

    for screen size put display instead of density

提交回复
热议问题