Impossible to rotate the emulator with android 4.4

2019-01-08 11:08发布

问题:

This question already has an answer here:

  • Android emulator not rotating to landscape 11 answers

I've updated my sdk to the latest version (android 4.4) and I started the emulator, but now it seems not possible to rotate the screen with CTRL+F11, the screen change but all the applications don't change. I don't know if it's a related issue but I can see that even if I created a new emulator with menù hw button, now all the applications have the overflow button.

回答1:

These appear to be bugs in the Android 4.4 emulator. You may wish to track the issues that I filed regarding the orientation change bug and the overflow affordance bug.

Thanks for pointing these out!



回答2:

There appears to be a bug in the emulator as described by CommonsWare, however, if you desperately need to debug an app in landscape mode on the 4.4 emulator you can:

  1. Start the Camera app on the emulator which will rotate the screen.
  2. Now exit the app, the home screen should now be sideways.
  3. Pressing Ctrl + F11 will do the trick. (Ctrl + fn + F11 on mac).


回答3:

Until it is fixed I use this free application "Set Orientation". Install the apk into emulator using adb install.



回答4:

I have found that this bug depends on which device type I select for the virtual-machine. If I set the device type as a "Nexus 7", it won't allow rotations. But if I set the device type as a generic 7" tablet, with all of the same options, rotations will work fine.



回答5:

In manifestfile.xml can put android:screenOrientation="landscape". When it has been Loaded you will see every app in landscape mode



回答6:

There is a work around for this. It seems the settings from the GUI isn't saved to the ini files. I had to manually edit fields "hw.keyboard=no" in both config.ini & hardware-qemu.ini within your avd directory.



回答7:

As a workaround, I cloned the device, swapped the width/height in the clone and unchecked portrait. Then launched my avd based on the cloned landscape version. Maybe that could work for you?



回答8:

I ran into the same issue when using the emulator running Android 5.0.1. However, I was able to resolve by using the emulator with Intel x86 Atom system image instead of the Intel x86 Atom_64 system image.



回答9:

I have found a solution to this problem -

  • Create emulator with whatever setting you want but set the Target to be less then Android 4.4.

For example -

I set it to the following -->

NOTE:

Because I want to use Android 4.4 with Google Maps API so I used Android 4.2.2 with Google Maps API here.

  • After creating the AVD, start it and lets get it started completely.

  • Now come back to this AVD and edit it. Here you set the Target to Android 4.4 with Google Maps API.

For example -

I set it to the following -->

  • Now start the application and rotate any way you want. It worked great!