Katherine Rix
Katherine Rix

Reputation: 672

How do I simulate rotating the device with Android emulator?

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

Answers (4)

Nelson
Nelson

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.

screenshot of the Extended Controls tool

Upvotes: 0

MonoThreaded
MonoThreaded

Reputation: 12073

Ctrl+Left and Ctrl+Right are your friends

Upvotes: 0

waqaslam
waqaslam

Reputation: 68187

I think, what you need is:

Ctrl+F11

Upvotes: 5

nandeesh
nandeesh

Reputation: 24820

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

Upvotes: 34

Related Questions