Skip to content

Instantly share code, notes, and snippets.

@alekseichuk
Forked from whunter/adb_rotation.sh
Created July 13, 2022 10:17
Show Gist options
  • Save alekseichuk/2d4801ee2ce1bc76be65974f0d51cc51 to your computer and use it in GitHub Desktop.
Save alekseichuk/2d4801ee2ce1bc76be65974f0d51cc51 to your computer and use it in GitHub Desktop.
android device display rotation via adb
# disable auto rotation
adb shell content insert --uri content://settings/system --bind name:s:accelerometer_rotation --bind value:i:0
# force landscape
adb shell content insert --uri content://settings/system --bind name:s:user_rotation --bind value:i:1
# back to portrait
adb shell content insert --uri content://settings/system --bind name:s:user_rotation --bind value:i:0
# upside down
adb shell content insert --uri content://settings/system --bind name:s:user_rotation --bind value:i:2
# "other" landscape
adb shell content insert --uri content://settings/system --bind name:s:user_rotation --bind value:i:3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment