android - 在不改变方向的情况下旋转 Android 显示器

标签 android adb screen-orientation

本质上,我要完成的是让一个矩形显示器侧向(垂直方向),Android 显示屏处于纵向位置。由于显示器的限制,在显示器本身上旋转显示是不可行的。首先我设置禁用自动旋转,然后将其设置为纵向模式。

adb shell content insert --uri content://settings/system --bind name:s:accelerometer_rotation --bind value:i:0  
adb shell content insert --uri content://settings/system --bind name:s:user_rotation --bind value:i:0

然后我尝试使用以下命令将分辨率更改为 1920x1080

adb shell wm size 1920x1080

然后这会使显示重新进入横向模式。我更愿意通过 adb 或任何不需要额外软件的方法来完成这个。

编辑:

澄清一下,我想在 Windows 计算机上模拟 CTRL+ALT+RIGHT ARROW,但在 Android 设备上最好通过 ADB 或除第 3 方应用程序之外的任何其他方法。

最佳答案

经过更多挖掘,我找到了相关答案。

其中一些可能不需要,但这是我为达到预期效果所做的。还有一个小故障,Android 不会更新旋转,因此在重新启动后,您必须将旋转更改为其他内容,然后再恢复为原始旋转。

adb shell root
adb shell remount
adb shell setprop persist.demo.hdmirotation portrait
adb shell setprop persist.demo.hdmirotationlock false
adb shell setprop persist.demo.singledisplay true
adb reboot
adb shell wm size 1080x1920
adb shell wm size 1920x1920

找到答案here ,并找到了相关文档here .

关于android - 在不改变方向的情况下旋转 Android 显示器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40094761/

相关文章:

android - 预期 @HiltAndroidApp 具有值。您是否忘记应用 Gradle 插件?

android - 亚行 shell : telnet command doesn't work

安卓扭曲的用户界面

android - application是不是取了layout-sw600dp-land文件夹下的xml文件?

安卓屏幕方向 : Portrait doesn't work

Android M 用户权限错误 - 读写

android - 错误 : OSCOKIRQ failed to assert

android - 如何自定义 CollapsingToolbarLayout 标题动画

android - 向 adb shell 发送多个相同的按键事件?

android - 如何在 Android 设备上安装 java 运行时?