当前位置:   article > 正文

adb shell wm 命令使用_adb shell wm density

adb shell wm density

1. 连接上设备,在控制台输入命令  adb shell wm help 

  1. home@home-MS-7B89:~$ adb shell wm help
  2. Window manager (window) commands:
  3. help
  4. Print this help text.
  5. s XXX 1 //or 0, true, false
  6. Set WindowManagerDebugConfig debug param to true/false.
  7. s debug_savestate 1 //or 0, true, false
  8. Set save WindowManagerDebugConfig debug state.
  9. s debug_liststate 1 //or 0, true, false
  10. List WindowManagerDebugConfig debug state.
  11. p XXX 1 //or 0, true, false
  12. Set PhoneWindowManager debug param to true/false.
  13. p debug_savestate 1 //or 0, true, false
  14. Set save PhoneWindowManager debug state.
  15. p debug_liststate 1 //or 0, true, false
  16. List PhoneWindowManager debug state.
  17. c windowName /data/misc/wmtrace/a.png
  18. capture the specific window's layer to bimmap
  19. size [reset|WxH|WdpxHdp]
  20. Return or override display size.
  21. width and height in pixels unless suffixed with 'dp'.
  22. density [reset|DENSITY]
  23. Return or override display density.
  24. overscan [reset|LEFT,TOP,RIGHT,BOTTOM]
  25. Set overscan area for display.
  26. scaling [off|auto]
  27. Set display scaling mode.
  28. dismiss-keyguard
  29. Dismiss the keyguard, prompting user for auth if necessary.
  30. folded-area [reset|LEFT,TOP,RIGHT,BOTTOM]
  31. Return or override folded area.
  32. set-user-rotation [free|lock] [-d DISPLAY_ID] [rotation]
  33. Set user rotation mode and user rotation.
  34. set-fix-to-user-rotation [-d DISPLAY_ID] [enabled|disabled]
  35. Enable or disable rotating display for app requested orientation.
  36. tracing (start | stop)
  37. Start or stop window tracing.

2. 上图是wm全部的命令, 我挑选工作中平时用的做解释说明

   1)  adb shell wm size  

         说明:查看屏幕的分辨率, 返回屏幕的宽高像素, 单位: px

  1. adb shell wm size
  2. Physical size: 1200x1920

    2) adb shell wm size 1080x1920

         说明: 自定义设置屏幕的分辨率 宽为1080px   高为1920px

  1. adb shell wm size 1080x1920
  2. Physical size: 1200x1920
  3. Override size: 1080x1920

    3) adb shell wm size reset 

        说明:把自定义的屏幕分辨率设置参数  重置

    4) adb shell wm density

           说明: 查看设备屏幕密度

  1. adb shell wm density
  2. Physical density: 320

    5) adb shell  wm density 240

            说明: 自定义设置设备屏幕密度

  1. adb shell wm density 240
  2. Physical density: 320
  3. Override density: 240

           同样 adb shell wm density reset 命令:  重置参数恢复默认

    6)adb shell wm overscan 

           说明: 设置显示区域大小 , 坐标值:依次为左、上、右、下

adb shell wm overscan 100,200,300,400

          同样 adb shell wm overscan reset :   重置参数恢复默认

       

     7)adb shell wm dismiss-keyguard

           说明: 前提没有设置数字,图案,PIN密码,如果是锁屏待机状态,执行此命令后,直接解锁进入桌面

     8)adb shell wm  c  xxx

            说明:将特定窗口的图层捕获为 bimmap,然后存到设备 /data/misc/wmtrace/a.png 此路径下

  1. adb shell wm c dsf
  2. use the default file path name /data/misc/wmtrace/a.png
  3. WindowName = dsf
  4. can not find the window dsf

后续再把工作中 adb shell  wm 用到的命令添加进来。

                

      

    

   

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/你好赵伟/article/detail/686845
推荐阅读
相关标签
  

闽ICP备14008679号