Friday, November 15, 2013

How to Speed ??up Android emulator? - The Android Free

intel-03

If you’re an Android developer, you know the emulator takes long time to boot (not to mention the slow performance once it is running) and this affects your productivity.

Fortunately, if you have a reasonably modern computer with an Intel ® have enabled Intel ® Virtualization Technology, you can make use of this technology to significantly speed up the Android emulator. This article will explain the steps to do this. It can be done both in Windows operating system and Mac OS and Linux. In the first two cases using Intel Hardware Accelerated Execution Manager (Intel HAXM), and in the case of Linux using KVM.


1. Introduction

Here we will guide to install the Intel ® Hardware Accelerated Execution Manager (Intel HAXM), engine hardware-assisted virtualization (hypervisor) using Intel ® Virtualization Technology (Intel VT) to accelerate Android development Windows and OSX. We also explain how to configure a kernel-based virtual machine (KVM) on Linux hardware assisted.


2. Installation

2.1. Prerequisites

Having installed

    • software development kit (SDK) for Android.
    • Your computer must have an Intel processor supporting Intel EM64T VT-x and, and functionality Execute Disable (XD) Bit enabled from the BIOS.

    2.2. Installation on Windows

    After installing the Android SDK, open the SDK Manager. In the extras section, you’ll find the Intel HAXM.

    Check the box and click on the “Install packages …” when you installed the package, the status will display as “Installed”. This is misleading as it is not actually installed. The SDK only copies the Intel executable HAXM to our machine, but still have to install it. To install the Intel executable HAXM, search your hard drive IntelHaxm.exe (or IntelHAXM.dmg on Mac OS X). If you leave all defaults should be in C: Program Files Android android-sdk extras Intel Hardware_Accelerated_Execution_Manager IntelHaxm.exe.

    Intel

    HAXM only works in combination with an image of the x86 Intel Atom processor. At the time of publication of this article are images available for Android x86 2.3.3 (API 10), 4.0.3 (API 15), 4.1.2 (API 16), 4.2.2 (API 17) and 4.3 (API 18). These images Intel system can be installed in the same way that images based on ARM, using the SDK manager.

    intel-01

    When you click on the executable IntelHaxm, shows a welcome screen like this:

    intel-02  intel-03

    can adjust the amount of RAM that is assigned to Intel HAXM. After setting, click “Next”. The next screen confirms the memory allocation. If everything is as you want, click “Install”.

    intel-04

    In order to install the Intel HAXM, you must have Intel VT-x enabled in the BIOS, if not, you’ll see an error like this during installation:

    intel-05

    If this error occurs, go to BIOS and habilítala.

    intel-06

    The second option to download the Intel HAXM and emulator system image x86 Emulator System Image is to go directly to the website: http://software.intel.com/es-es/android and download from there all necessary components.

    2.3. Installing on Linux

    steps to speed up the Android emulator on Linux is different than Windows and Mac OS X, because Intel HAXM does not support Linux, so it is necessary to use KVM instead. The steps shown below are for Ubuntu * 12.04 and may differ slightly in other Linux distributions.


    2.3.1. Installing KVM

    To install and run KVM, you first need to check that your CPU supports hardware virtualization. Perhaps the most practical way to do this is with the command “kvm-ok” found in the package “cpu-checker”.


    $ sudo apt-get install cpu-checker

    $ sudo kvm-ok

    This command will indicate if our team has the ability to run KVM and if it is enabled in the BIOS or we have to enable it.

    The next step is to install the KVM and other necessary packages. To do this, type:

    $ sudo apt-get install qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils

    If you get a Postfix configuration screen, select “No configuration”.

    Then add your user to the KVM and libvirtd group. To do this, type:

    your_user_name

    kvm $ sudo adduser

    your_user_name

    libvirtd $ sudo adduser

    After installation, log on again and the changes take effect. To test the installation, type:

    $ sudo virsh-c qemu :/ / / system list

    Now you can go to the next step, which is to create and run the Android Virtual Device (AVD). This procedure is the same for Linux and Windows.


    2.4. How to Create an AVD (Android Virtual Device *)

    After installing the SDK and Intel HAXM (or KVM on Linux), you can create a virtual device that has hardware accelerated emulation. To do this, go to AVD Manager and create a new device. Be sure to select Intel Atom (x86) and CPU / ABI. This selection only appears in the dropdown menu if you have installed the Intel x86 system image, so that the graphics are softer enable GPU emulation when creating the AVD.

    intel-07

    Click New and make AVD x86. Make sure you choose an API compatible with x86 system images that CPU / ABI is set to x86 and emulation have enabled GPU (OpenGL ES *). When you have done this, click Create AVD to create the AVD.

    To start the AVD

    x86, click Start, and then click Launch.

    intel-08

    If the installation was successful when the emulator is booting, you will see a dialog box indicating that HAXM Intel is running in virtual mode fast. You can also check the details in “About phone” within the emulator.


    Conclusion

    In this article we reviewed how we can leverage the capabilities of Intel processors to speed up the Android emulator for Windows, Mac and Linux. Improving performance with Intel appreciate HAXM or KVM depends on your team, but it should be between 5 and 10 times better than when not using acceleration.

    If you want more tools and resources offered by Intel for Android developers, we recommend you visit the Android Developer Zone http://software.intel.com/es-es/android

  • No comments:

    Post a Comment