Skip to content

Instantly share code, notes, and snippets.

@picosaur
Forked from whunter/adb_rotation.sh
Created October 15, 2024 22:09
Show Gist options
  • Save picosaur/0fa0c1f26079bab8111447a3dfe2c101 to your computer and use it in GitHub Desktop.
Save picosaur/0fa0c1f26079bab8111447a3dfe2c101 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