161

I am new to Android development.
I know if you change a android phone from portrait to landscape sometimes the app relays its self out on the screen.. so how do I simulate rotating a phone with the emulator? On the Blackberry emulators there's a button in the menu to turn the phone, but I can't find it or any option on the Android ones?

What am I missing?

SaurabhJinturkar
  • 554
  • 7
  • 20
Bex
  • 4,898
  • 11
  • 50
  • 87

3 Answers3

248

See the Android documentation on controlling the emulator; it's Ctrl + F11 / Ctrl + F12.

On ThinkPad running Ubuntu, you may try CTRL + Left Arrow Key or Right Arrow Key

Yoni Samlan
  • 37,905
  • 5
  • 60
  • 62
  • 34
    on mac: fn+control+F11 or fn+control+f12 – Fresheyeball Jul 25 '12 at 23:58
  • 5
    It rotates, but if you design a view to work on both portrait and landscape, the app wont be rotated, only the windows, so its like you rotate your phone 90 degrees but the app keeps in portrait mode. – Mateus Viccari May 24 '14 at 17:06
  • 1
    @MateusViccari That's a bug in the Android 4.4 emulator image. See http://stackoverflow.com/questions/19726285/impossible-to-rotate-the-emulator-with-android-4-4. Other emulator images should work fine. – Yoni Samlan May 27 '14 at 21:14
  • @YoniSamlan, Right Ctrl button doesn't work. Only left works. – Pacerier Jul 01 '15 at 10:06
92

Officially it's Ctrl+F11 & Ctrl+F12 or KEYPAD 7 & KEYPAD 9.

In practise it's a bit quirky.

  1. Specifically it's Left Ctrl+F11 and Left Ctrl+F12 to switch to previous orientation and next orientation respectively.

  2. You have to release Ctrl before you can rotate again.

  3. KEYPAD 7 and KEYPAD 9 only work with Num Lock OFF (so they're acting as Home & PageUp rather than 7 & 9).

  4. The only orientations are vertically upright and rotated one quarter-turn anti-clockwise.

Maybe a bit too much info for such a simple question, but it drove me half-mad finding this out.

Note: This was tested on Android SDK R16 and a very old keyboard, modern keyboards may behave differently.

Pacerier
  • 86,231
  • 106
  • 366
  • 634
vowel-house-might
  • 1,686
  • 14
  • 18
  • Again thank you for your answer, but this question was asked (and resolved) in 2010 ! – Bex Mar 09 '12 at 08:56
  • 5
    @Bex I just had some frustration to vent (thanks to the quirks listed), so I channelled it into a post. – vowel-house-might Mar 13 '12 at 11:18
  • May help someone then. Can't say I have these problems though! – Bex Mar 13 '12 at 15:08
  • 10
    @Bex: Yes, and Andrew added some great details that weren't in the original answer of just a link. Stack Overflow is about creating useful and lasting artifacts on the Internet, so thanks to Andrew for improving the internet! – Jim McKeeth Jun 17 '12 at 02:17
  • 5
    This is still the same. **This should be the accepted answer!** I don't get why it's so quirky. I was pressing the right-Ctrl and it didn't work at all! Normally, applications shouldn't distinguish between the two control keys - that kind of distinguishing is reserved for video games and specialized applications! And having to release the Ctrl key is just ridiculous. – ADTC Jul 27 '13 at 05:29
  • Only the numpad works for me. – 3k- Aug 08 '13 at 10:54
  • 1
    Numpad => It works for me **only** with **Num Lock** set to **ON**. If it's off does not work for me. For the rest, answer should be the accepted one. – Xavi Montero Nov 17 '14 at 00:40
35

Yes. Thanks

Ctrl + F11 for Portrait

and

Ctrl + F12 for Landscape

Darren
  • 68,902
  • 24
  • 138
  • 144
Anshuman
  • 351
  • 3
  • 2