VOOZH about

URL: https://www.javacodegeeks.com/2013/12/android-boost-up-the-android-emulator-speed-up-to-400-on-intel-based-architecture.html

โ‡ฑ Android: Boost up the Android emulator speed up to 400% on Intel based architecture - Java Code Geeks


In my previous post package into its Device Emulator from the command line. I have demonstrated how to add your compiled .apk file to android emulator, from command line with adb command, included in ADT platform tools.

One of my friends commented:
"
Are u really using the emulatorโ€ฆ..it is very slow. Even on the fastest machines. I always use a real device."

From this comment, I have made some R&D about this problem, and especially this tools are developed by Google ;), and indeed they know about this symptom.

Also testing on real devices are very costly and time consuming process, as we have a variety of devices varies from multiple screen sizes, which are one of Android developerโ€™s worst nightmares. There are a huge number of different screen configurations of Android devices.

๐Ÿ‘ a1

The great thing about using an emulator for development is that it gives you an opportunity to develop applications without having a real Android device. The default Android emulator comes together with the Android SDK and can be found in the "tools" folder.

So far so good, we have our coffee, but can we drink it? The answer comes about 5 minutes after we hit the "Launch" button. Go grab a coffee. Have breakfast. Come back. Wait another 5 minutes. Maybe even more.

In meantime, the default Android emulator is notoriously slow. So, what should we do? That is easy โ€“ start using a properly fast Android emulator.

Emulation vs. Simulation

If you are using Apple iPhone simulators, you will find that the iPhone simulator does not have the same issue as the Android Emulator.

One of the reasons for this is that it does not run a โ€œreal emulatorโ€, because the CPU instruction used by the iPhone simulator is the same as the one used by the host (x86).

On the contrary, Android Emulator emulates a real ARM processor on top of an x86 processor. This is a lot of overhead.

At least for quick test and demonstration purposes, I do not need to emulate an ARM processor; I just need to be able to run Android and my application. The main objective before releasing an application is to find bugs and design imperfections.

Okay, it is slow. Then what can we do about it?

Let us go through steps to solve the slowness problem of Android emulator;

  1. First, let us delegate the rendering process to host GPU instead of overhead our CPU by this process, it will make it happy. Do it by checking "Use Host GPU" checkbox in AVDโ€™s edit window.

    The screen should now look better and be more responsive. That is because the CPU is happy to not dealing with the tedious work of doing rendering anymore. However, that is still not fast enough.

    ๐Ÿ‘ a2

  2. Second we need to download Intel Atom (x86) system image for each Android version you need to use for testing.

    ๐Ÿ‘ a3

  3. Third, download Intel x86 Emulator Accelerator (HAXM, for Mac and Windows only). This will enable virtual machine acceleration capabilities of the Intel CPU, from Android SDK manager โ€“> tools. Or install it from .

    ๐Ÿ‘ a4

  4. The SDK only copies the Intel HAXM executable on your machine, and it is up to you to install the executable.

    To install the Intel HAXM executable, search your hard drive for IntelHaxm.exe (or IntelHAXM.dmg on Mac OS X). If you left everything to default, it should be located at %Android_HOME%\sdk\extras\Intel\Hardware_Accelerated_Execution_Manager\IntelHaxm.exe.

    Intel HAXM only works in combination with one of the Intelยฎ Atomโ„ข processor x86 system images.

    ๐Ÿ‘ a5

  5. In order to be able to install the Intel HAXM, you need to have Intel VT-x enabled in your BIOS, otherwise you will get an error like this during install.

    ๐Ÿ‘ a5b

    Enabling Intel VT (Virtualization Technology)

    ๐Ÿ‘ a6

    How do I enable Intel VT in your machine BIOS?

    1. Boot into BIOS.
    2. Select "Config".
    3. Select "CPU".
    4. Press enter at "Intel Virtualization Technology".
    5. Select "Disable".
    6. Press F10 and select Yes.
    7. Boot into Windows then shutdown the system.
    8. Boot into BIOS again.
    9. Select "Enable" โ€“ Intel Virtualization Technology.
    10. Press F10 and select Yes.
  6. After installation goes successful, edit your AVD and chose Intelยฎ Atom (x86).

    ๐Ÿ‘ a8

  7. Finally Hit okay, then lunch your cake and definitely enjoy the speed.

VIP Note:
You could say that this level of speed should be sufficient. That may be true, but an issue with the Intel x86 images is that you do not get Google Apps, they only come with ARM images. This is important if you are testing an app that uses GMaps, or .
 

Do you want to know how to develop your skillset to become a Java Rockstar?
Subscribe to our newsletter to start Rocking right now!
To get you started we give you our best selling eBooks for FREE!
1. JPA Mini Book
2. JVM Troubleshooting Guide
3. JUnit Tutorial for Unit Testing
4. Java Annotations Tutorial
5. Java Interview Questions
6. Spring Interview Questions
7. Android UI Design
and many more ....
I agree to the Terms and Privacy Policy

Thank you!

We will contact you soon.

๐Ÿ‘ Photo of Mohamed Taman
Mohamed Taman
December 13th, 2013Last Updated: December 13th, 2013
21 362 3 minutes read
Subscribe

This site uses Akismet to reduce spam. Learn how your comment data is processed.

21 Comments
Oldest
Newest Most Voted
kaoruAngel
12 years ago

Thanks for the excellent tip. Though the logic behind the change in emulation mode downright straightforward and Iโ€™d like to believe that I would have made such a change on my own after about a dozen times fighting with the ARM emulator, the fact is that many people are trained to quickly work /around/ their problems rather than potentially spending more time solving them. Because of that (and because I believe the Intel images were only recently introduced), Iโ€™m sure there are a ton of people that have simply turned to device-only testing when possible, before geting the chance toโ€ฆ Read more ยป

0
Reply
Amir
11 years ago

thanks for your post
i have some problem with this , first i download intel atom x86 for androdi 4.4.2 and then install intelhaxm .
but when i want to create a new virtual android i dont see intel atom x86 under cpu/bus
can you help me about this problem
thanks alot

0
Reply
giova
11 years ago
Reply to  Amir

make sure that API version matches.
There is a โ€œintel atom x86 for androidโ€ for each api version

0
Reply
11 years ago
Reply to  Amir

Make sure you downloaded correct virtual machine image

0
Reply
giova
11 years ago

Thank you sooo much for this article, you saved my life !
arm was making me nuts

0
Reply
JW
11 years ago

Hi,

Is there a comparable image and accelerator for my PC that has an AMD processor chip rather than an Intel chip?

0
Reply
11 years ago
Reply to  JW

Sorry for that as i have seen only ARM and intel has VM images provided from google

0
Reply
emir
11 years ago

hi. i do it

in my eclipse this message show and emulate do not lunch!

Waiting for HOME (โ€˜android.process.acoreโ€™) to be launched..

can u help me?

tank u much.

0
Reply
Mayur Thole
11 years ago

I am getting an error in Log Cat

Couldnโ€™t load memtrack module (No such file or directory)
failed to load memtrack module: -2

after installing Intel Virtualization Technology. ..I followed all the steps of above mentioned. plz give me proper guidance. Email Id: mayurthole12@gmail.com

0
Reply
Alexandre
11 years ago

Thank you man. Android Emulator was driving me crazy.

0
Reply
Muhammad Atif Agha
11 years ago

The best solution ever
greattttt!!!!!!!!!!!!!!!!1

0
Reply
ashish Mathur
10 years ago

use genymotion rather.. Best emulator..

0
Reply
5 years ago

Thank you for helping

0
Reply
5 years ago

Thank you for helping

0
Reply
5 years ago

very helpful information. Thank you

0
Reply
4 years ago

what a great website. thank you for a helpful article.

0
Reply
4 years ago

thank you for this post. my problem has been solved after reading this post.

0
Reply
4 years ago

Thnks very informative post, due to this article we resloved our problem

0
Reply
3 years ago

This is very helpful information, i got answer of my question after reading discussion

0
Reply
3 years ago

very helpful information. Thank you

0
Reply
2 years ago

Thank you for the good information and very helpful. Thatโ€™s very interesting.

0
Reply
Back to top button
Close
wpDiscuz