Configuring VM Acceleration on Windows

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



Configuring Virtual Machine Acceleration

Caution: As of SDK Tools Revision 17, the virtual machine acceleration feature for the emulator is experimental; be alert for incompatibilities and errors when using this feature.

Many modern CPUs provide extensions for running virtual machines (VMs) more efficiently. Taking advantage of these extensions with the Android emulator requires some additional configuration of your development system, but can significantly improve the execution speed. Before attempting to use this type of acceleration, you should first determine if your development system’s CPU supports one of the following virtualization extensions technologies:

  • Intel Virtualization Technology (VT, VT-x, vmx) extensions
  • AMD Virtualization (AMD-V, SVM) extensions (only supported for Linux)

The specifications from the manufacturer of your CPU should indicate if it supports virtualization extensions. If your CPU does not support one of these virtualization technologies, then you cannot use virtual machine acceleration.

Note: Virtualization extensions are typically enabled through your computer's BIOS and are frequently turned off by default. Check the documentation for your system's motherboard to find out how to enable virtualization extensions.

Once you have determined that your CPU supports virtualization extensions, make sure you can work within these additional requirements of running an emulator inside an accelerated virtual machine:

  • x86 AVD Only - You must use an AVD that is uses an x86 system image target. AVDs that use ARM-based system images cannot be accelerated using the emulator configurations described here.
  • Not Inside a VM - You cannot run a VM-accelerated emulator inside another virtual machine, such as a VirtualBox or VMWare-hosted virtual machine. You must run the emulator directly on your system hardware.
  • Other VM Drivers - If you are running another virtualization technology on your system such as VirtualBox or VMWare, you may need to unload the driver for that virtual machine hosting software before running an accelerated emulator.
  • OpenGL® Graphics - Emulation of OpenGL ES graphics may not perform at the same level as an actual device.

To use virtual machine acceleration with the emulator, you need the following version of Android development tools. Use the Android SDK Manager to install these components:

  • Android SDK Tools, Revision 17 or higher
  • Android x86-based system image

If your development environment meets all of the requirements for running a VM-accelerated emulator, you can use the AVD Manager to create an x86-based AVD configuration:

  1. In the Android SDK Manager, make sure you have an x86-based System Image installed for your target Android version. If you do not have an x86 System Image installed, select one in the Android SDK Manager and install it.

    Tip: System images are listed under each API Level in the SDK Manager. An x86 system image may not be available for all API levels.

  2. Start the AVD Manager and create a new AVD with an x86 value for the CPU/ABI field. You may need to select a specific Target value, or select a Target value and then select a specific CPU/ABI option.
  3. Name the emulator instance and select any other configuration options.
  4. Click Create AVD to save the emulator configuration.
Configuring VM Acceleration on Windows

Virtual machine acceleration for Windows requires the installation of the Intel Hardware Accelerated Execution Manager (Intel HAXM). The software requires an Intel CPU with Virtualization Technology (VT) support and one of the following operating systems:

  • Windows 7 (32/64-bit)
  • Windows Vista (32/64-bit)
  • Windows XP (32-bit only)

To install the virtualization driver:

  1. Start the Android SDK Manager, select Extras and then select Intel Hardware Accelerated Execution Manager.
  2. After the download completes, execute<sdk>/extras/intel/Hardware_Accelerated_Execution_Manager/IntelHAXM.exe.
  3. Follow the on-screen instructions to complete installation.
  4. After installation completes, confirm that the virtualization driver is operating correctly by opening a command prompt window and running the following command:
    sc query intelhaxm

    You should see a status message including the following information:

    SERVICE_NAME: intelhaxm
           ...
           STATE              : 4  RUNNING
           ...

To run an x86-based emulator with VM acceleration:

  • If you are running the emulator from the command line, just specify an x86-based AVD:
    emulator -avd <avd_name>

    Note: You must provide an x86-based AVD configuration name, otherwise VM acceleration will not be enabled.

  • If you are running the emulator from Eclipse, run your Android application with an x86-based AVD:
    1. In Eclipse, click your Android project folder and then select Run > Run Configurations...
    2. In the left panel of the Run Configurations dialog, select your Android project run configuration or create a new configuration.
    3. Click the Target tab.
    4. Select the x86-based AVD you created previously.
    5. Run your Android project using this run configuration.

You can adjust the amount of memory available to the Intel HAXM kernel extension by re-running its installer.

You can stop using the virtualization driver by uninstalling it. Re-run the installer or use the Control Panel to remove the software.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值