我在真实设备上使用 Android 4.4,我想通过 adb
设置设备方向。我不希望使用 uiautomator 完成它,因为它在 uiautomator 代码终止后不会持续。
我该怎么做?
最佳答案
除了使用“adb shell 内容”之外,还有一种更简洁的方法是使用“adb shell 设置”。他们正在做同样的事情,为设置提供者提供值(value)。
adb shell settings put system accelerometer_rotation 0 #disable auto-rotate
adb shell settings put system user_rotation 3 #270° clockwise
accelerometer_rotation:自动旋转,0 禁用,1 启用
user_rotation:实际旋转,顺时针,0 0°,1 90°,2 180°,3 270°
关于android - 使用 ADB 更改 Android 设备方向,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25864385/