10

I am running Android via the SDK emulator on Ubuntu. When you rotate some devices, they reset the layout to match (from portrait to landscape, or landscape to portrait). How can I simulate this on the emulator?

(Is this the same as simulating the accelerometer, for example with OpenIntents' SensorSimulator, or is there more to it?)

Community
  • 1
  • 1
Katherine Rix
  • 672
  • 2
  • 8
  • 18

4 Answers4

34

you can use KEYPAD_7, Ctrl-F11 ,KEYPAD_9 or Ctrl-F12 to move to the next orientation

nandeesh
  • 24,740
  • 6
  • 69
  • 79
  • thanks nandeesh! is this referenced in the android documentation? if so could you provide a link? finally, these keys seem to rotate the phone between two orientations only (left-side down, bottom down), is this correct? (I can't turn it right-down or upside down) – Katherine Rix Aug 07 '12 at 19:43
  • 1
    you can check here. http://developer.android.com/tools/help/emulator.html . If you repeatedly press KEYPAD_9 then it will rotate upside down i guess. – nandeesh Aug 08 '12 at 05:16
  • Seems outdated (?) – MonoThreaded May 07 '16 at 15:02
5

I think, what you need is:

Ctrl+F11

waqaslam
  • 67,549
  • 16
  • 165
  • 178
0

Ctrl+Left and Ctrl+Right are your friends

MonoThreaded
  • 11,429
  • 12
  • 71
  • 102
0

The answer to this question has changed in 2023. Under the "Pixel 3 API 28" emulator running on Android Studio Flamingo | 2022.2.1, there's a whole series of Extended Controls for simulating sensor inputs.

You can control the 3d orientation of the simulated device by opening the Extended Controls dialog with the 3 dots vertical menu in the Android emulator pane. That pops up a window; choose "Virtual sensors", then the "Device Pose" tab. It contains sliders to rotate the device in 3 axes.

Here's a screenshot of it in action while running a bubble/spirit level app.

screenshot of the Extended Controls tool

Nelson
  • 27,541
  • 5
  • 35
  • 31