Changing Android Device orientation with ADB

前端 未结 3 1414
遥遥无期
遥遥无期 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:17

    You may first need to turn off the automatic rotation:

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

    Rotate to landscape:

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

    Rotate portrait:

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

提交回复
热议问题