adb shell wm命令及用法:
Posted Mars-xq
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了adb shell wm命令及用法:相关的知识,希望对你有一定的参考价值。
参考
adb shell wm 帮助:
> adb shell wm
Window manager (window) commands:
help
Print this help text.
size [reset|WxH|WdpxHdp] [-d DISPLAY_ID]
Return or override display size.
width and height in pixels unless suffixed with 'dp'.
density [reset|DENSITY] [-d DISPLAY_ID]
Return or override display density.
folded-area [reset|LEFT,TOP,RIGHT,BOTTOM]
Return or override folded area.
scaling [off|auto] [-d DISPLAY_ID]
Set display scaling mode.
dismiss-keyguard
Dismiss the keyguard, prompting user for auth if necessary.
disable-blur [true|1|false|0]
user-rotation [-d DISPLAY_ID] [free|lock] [rotation]
Print or set user rotation mode and user rotation.
dump-visible-window-views
Dumps the encoded view hierarchies of visible windows
fixed-to-user-rotation [-d DISPLAY_ID] [enabled|disabled|default]
Print or set rotating display for app requested orientation.
set-ignore-orientation-request [-d DISPLAY_ID] [true|1|false|0]
get-ignore-orientation-request [-d DISPLAY_ID]
If app requested orientation should be ignored.
set-multi-window-config
Sets options to determine if activity should be shown in multi window:
--supportsNonResizable [configValue]
Whether the device supports non-resizable activity in multi window.
-1: The device doesn't support non-resizable in multi window.
0: The device supports non-resizable in multi window only if
this is a large screen device.
1: The device always supports non-resizable in multi window.
--respectsActivityMinWidthHeight [configValue]
Whether the device checks the activity min width/height to determine
if it can be shown in multi window.
-1: The device ignores the activity min width/height when determining
if it can be shown in multi window.
0: If this is a small screen, the device compares the activity min
width/height with the min multi window modes dimensions
the device supports to determine if the activity can be shown in
multi window.
1: The device always compare the activity min width/height with the
min multi window dimensions the device supports to determine if
the activity can be shown in multi window.
get-multi-window-config
Prints values of the multi window config options.
reset-multi-window-config
Resets overrides to default values of the multi window config options.
reset [-d DISPLAY_ID]
Reset all override settings.
tracing (start | stop)
Start or stop window tracing.
logging (start | stop | enable | disable | enable-text | disable-text)
Logging settings.
adb shell wm
通过vm设置后,重启手机仍有效,若想恢复默认值,则需要reset,如:
adb shell wm size reset
1.adb shell wm size 查看手机分辨率
如:
adb shell wm size
结果:Physical size: 1080x1920
也可以设置成其他分辨率
如:
adb shell wm size 720x1280
结果:Physical size: 720x1280
2.adb shell wm density 查看屏幕密度
如:
adb shell wm density
结果:Physical density: 480
也可以设置成其他屏幕密度
如:
adb shell wm density 200
结果:Physical density: 200
3.adb shell wm overscan 设置窗口的显示位置
如:
adb shell wm overscan 200,300,400,500
以上是关于adb shell wm命令及用法:的主要内容,如果未能解决你的问题,请参考以下文章