11

My laptop supports hardware virtualization (AMD SVM) and I know that:

  • QEMU can make use of hardware virtualization through KVM;
  • The Android emulator is very much based on QEMU

Natural question follows: can I combine the two (Android+KVM) to get improved performance in the emulator?

VividD
  • 10,456
  • 6
  • 64
  • 111
Felix
  • 88,392
  • 43
  • 149
  • 167
  • Someone wrote a paper on this exact topic: http://docs.google.com/viewer?a=v&q=cache:0yb3-Nl7LnkJ:www.chazy.dk/android-report.pdf+hardware+virtualization+android&hl=en&gl=us&pid=bl&srcid=ADGEESgHryptG0TRqedonN4eSTmgF1B9OomzebgVuuTxbBMv5TQrs7JW-CdL25S3jDFi3FMObVyql8YgWrNT4aKuypGtBvVwdvdi9G6spV2k3DVcRWEUVvVlcrVyOKJjbaV0n2M9UkuZ&sig=AHIEtbTfBi6It8Xx1F9cOa3VLiRV21RN9g – Eric Mill Oct 26 '10 at 02:11
  • As this is a very old question (2010) the correct answer at the time was @RichieHindle's -- that you can't. In more recent times, though, Google has released updated versions of the emulator and special AVDs (Intel-based) that can be hardware accelerated. – Felix Jan 14 '13 at 09:26
  • @Konklone except that it's KVM on ARM, not x86. :) – Isa A Jul 01 '14 at 04:00
  • @Felix : ... and regarding your comment of Jan 14 '13 ... only on Intel hardware. If you're on AMD, apparently, you can go to hell. Relevant error string for Googling... "emulator: WARNING: Host CPU is missing the following feature(s) required for x86 emulation: SSSE3". The qemus in the SDK fail without this support (in spite of being able to trap and implement in software). See [Issue 33483](https://code.google.com/p/android/issues/detail?id=33483) which was putatively fixable in December 2012, and then (incorrectly) closed as obsolete in December 2014. – Eric Towers Jan 06 '16 at 05:54

5 Answers5

8

Yes, you can. Just download the appropriate Intel atom CPU packages in the Android SDK and have your AVD use an Intel atom CPU architecture. The android emulator can even use the host gpu. Here is a link on how to do it:

http://developer.android.com/tools/devices/emulator.html#acceleration

Felix
  • 88,392
  • 43
  • 149
  • 167
David Evans
  • 96
  • 2
  • 2
2

You can try to use AndroidVM - http://androvm.org/blog/ ... In my testing you can have Hardware OpenGL and Rotation Support as well (this is slightly convoluted but everything is explained on the AndroidVM page).

In my experience this is miles better than the Android SDK Emulator, at least on Windows and Mac.

For Linux, you should be able to use VirtualBox for Linux to use AndroidVM. Since it is an OVA file mainly, you should be able to use other Virtualisation clients as needed.

What's interesting is that this is NOT emulating ARM, it is Android on x86... which has pros and cons, but definitely helps in not having to buy a ton of devices if you can do initial testing of various sorts on virtual machines, since Android 4.1 is generally not too heavily modified by manufacturers across ARM and x86 phones and tablets, etc (IMO).

Bill the Lizard
  • 398,270
  • 210
  • 566
  • 880
SaltySub2
  • 299
  • 2
  • 6
  • For googlers - The above link now redirects to genymotion (the commercial venture of the androidvm line of things) I think the open-source aspect of their enterprise has gone away though. https://www.genymotion.com/ – oPless Apr 11 '17 at 12:02
2

You can run Android-x86 in QEMU with KVM (or even in VirtualBox). I'm not sure how easy it would be to set up for development but it should run quite a bit faster. Also, Intel are working on getting Android on their x86 chips so this will hopefully become easier in the future.

Update: I managed to get it working in VirtualBox, except some sites crash the web browser. Since I was making a web app, this was not helpful. It was much faster than the standard Android emulator though,

dave1010
  • 15,135
  • 7
  • 67
  • 64
0

Not closely related to the answer you are after, but

  • use Run when you work on your interface, or as much as possible while coding (it's a lot faster compared to Debug, even 10 times faster)
  • try to minimize the Debug runs, learn to code perfect, so use less Debug.
  • probably you already know, you don't need to close the Emulator for each run session, so keep it open.
  • restart Eclipse after hour of usage, but keep the Emulator open. It's faster to restart Eclipse than the Emulator.
  • set Eclipse to remember the last run project, so the launch is done via just one click
Community
  • 1
  • 1
Pentium10
  • 204,586
  • 122
  • 423
  • 502
  • I do all these things already, but thanks. About the Debug runs, I actually never use them. I debug my app using `logcat` (I'm old-school like that). – Felix Apr 08 '10 at 10:49
  • Learn to code perfectly. Oh man, if that would be possible, we wouldn't need IDEs, debug applications, and so many tests. Hah. – Apache Apr 21 '12 at 18:37
0

Google TV emulator which is targeted at x86 supports KVM mode virtualization.

ARM is not there yet. I believe it's currently work-in-progress.

Afriza N. Arief
  • 7,696
  • 5
  • 47
  • 74