adb shell wm 命令获取屏幕相关信息

adb shell wm命令获取屏幕相关信息

Tags: adb_shell


wm命令在4.x才有的,不同的版本下部分参数不同

wm [subcommand] [options]
获取屏幕大小:wm size
获取屏幕密度:wm density

i.e.

# 当前分辨率 width x height
wm size
> Physical size: 720x1280
# 当前屏幕密度
wm density
> Physical density: 320
# 改变屏幕的分辨率
wm size 1080x1920
# 重置分辨率
wm size reset
# 截屏命令
wm screen-capture

查看帮助命令

shell@htc_himauhl:/ $ wm
usage: wm [subcommand] [options]
       wm size [reset|WxH|WdpxHdp]
       wm density [reset|DENSITY]
       wm overscan [reset|LEFT,TOP,RIGHT,BOTTOM]
       wm scaling [off|auto]
       wm screen-capture [userId] [true|false]

wm size: return or override display size.
         width and height in pixels unless suffixed with 'dp'.

wm density: override display density.

wm overscan: set overscan area for display.

wm scaling: set display scaling mode.

wm screen-capture: enable/disable screen capture.

wm dismiss-keyguard: dismiss the keyguard, prompting the user for auth if necessary.
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • adb logcat 命令格式 : adb logcat [选项] [过滤项], 其中 选项 和 过滤项 在 中括...
    skyyhu阅读 699评论 0 1
  • adb:Android 调试桥接 Android Debug Bridge,是一个 C/S 架构的命令行工具 a...
    LLd_阅读 3,143评论 0 3
  • 在使用RecyclerView时,突然发现数据无法显示出去 在使用RecyclerView时,突然发现数据无法显示...
    sakurajiang阅读 21,693评论 6 14
  • 两周的见习紧张而忙碌。在这两周期间,方源、程芳菲除了做好日常的工作学习之外,还协助见习学校组织了一场大型的艺术节汇...
    梅洛的听雨轩阅读 165评论 0 0