Changing Android Device orientation with ADB

前端 未结 3 1393
遥遥无期
遥遥无期 2020-12-13 00:23

I\'m using Android 4.4 on a real device and I want to set the device orientation via adb. I don\'t want it done with uiautomator since it won\'t last after the

3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-13 01:18

    Instead of using "adb shell content", there's a more clean way by using "adb shell settings". They are doing the same thing, put value to settings provider.

    adb shell settings put system accelerometer_rotation 0  #disable auto-rotate
    adb shell settings put system user_rotation 3  #270° clockwise
    
    • accelerometer_rotation: auto-rotation, 0 disable, 1 enable
    • user_rotation: actual rotation, clockwise, 0 0°, 1 90°, 2 180°, 3 270°

提交回复
热议问题