Created
November 17, 2014 15:37
-
-
Save anry200/a650f1e4601c6cca0125 to your computer and use it in GitHub Desktop.
device rotation adb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
disable accelerometer controlling rotation - just do this once | |
adb shell content insert --uri content://settings/system --bind name:s:accelerometer_rotation --bind value:i:0 | |
rotate 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 | |
rotate upside down landscape: | |
adb shell content insert --uri content://settings/system --bind name:s:user_rotation --bind value:i:3 | |
rotate upside down portrait: | |
adb shell content insert --uri content://settings/system --bind name:s:user_rotation --bind value:i:2 | |
If you have WRITE_SETTINGS permission you can write thru the content provider in java code as well. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment