Skip to content

Instantly share code, notes, and snippets.

@anry200
Created November 17, 2014 15:37
Show Gist options
  • Save anry200/a650f1e4601c6cca0125 to your computer and use it in GitHub Desktop.
Save anry200/a650f1e4601c6cca0125 to your computer and use it in GitHub Desktop.
device rotation adb
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