Android emulator - Screen rotation

前端 未结 5 819
滥情空心
滥情空心 2020-12-04 17:10

I would like to test the rotation of a phone on the emulator, I see everywhere that we have to use Ctrl+F11 but it only rotates the im

相关标签:
5条回答
  • Also you can do:

    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.

    0 讨论(0)
  • 2020-12-04 17:31

    http://developer.android.com/tools/help/emulator.html this should do it

    did you also support portrait and landscape mode

    0 讨论(0)
  • 2020-12-04 17:38

    this just doesn't work in 2.3 emulators, if that's what ur using

    see here:

    Android - Emulator in landscape mode, screen does not rotate

    0 讨论(0)
  • 2020-12-04 17:43

    As suggested by Nicolas Jafelle here, you can try to add the property "Keyboard Support-->yes" in the emulator settings. That helped me.

    PS: it will also allow for your emulator to get input from your keyboard. See more here

    0 讨论(0)
  • 2020-12-04 17:49

    I did the same thing as you and turned the "auto-rotate screen" option on in the AVD. Worked like a charm.

    0 讨论(0)
提交回复
热议问题