Reputation: 672
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?)
Upvotes: 10
Views: 9631
Reputation: 29806
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.
Upvotes: 0
Reputation: 24820
you can use KEYPAD_7, Ctrl-F11 ,KEYPAD_9 or Ctrl-F12 to move to the next orientation
Upvotes: 34