如何从adb命令行获取Android设备的屏幕尺寸? [英] How to get the Android device screen size from the adb command line?

查看:186
本文介绍了如何从adb命令行获取Android设备的屏幕尺寸?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一种使用adb检测设备屏幕尺寸和密度的方法。
如果没有解决方案,我在哪里可以得到所有现有android设备及其屏幕大小和密度的完整列表?

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 ?

推荐答案

您还可以通过ADB访问WindowManager:

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]

以下命令将为您提供密度:

The following command will give you 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

这篇关于如何从adb命令行获取Android设备的屏幕尺寸?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆