To install Intel® HAXM: Open the downloaded DMG file and run the installer inside it. Click Continue to start the installation. Adjust the amount of RAM to be allocated to Intel® HAXM or set it to 2048 MB as the default value. The installer also functions as a configuration tool for Intel® HAXM. Jun 26, 2014. Jan 12, 2014. Install HAXM; And then of course, you need to go through a similar mess if you want to turn Hyper-V back on. For me, HAXM has a single purpose - to get Visual Studio to stop complaining when I emulate Android whereas Hyper-V has multiple uses in other aspects of my computer use. The Microsoft docs themselves state that.
-->This article explains how to use your computer's hardware accelerationfeatures to maximize Android Emulator performance.
Visual Studio makes it easier for developers to test and debug theirXamarin.Android applications by using the Android emulator insituations where an Android device is unavailable or impractical.However, the Android emulator runs too slowly if hardware accelerationis not available on the computer that runs it. You can drasticallyimprove the performance of the Android emulator by using special x86virtual device images in conjunction with the virtualization featuresof your computer.
Scenario | HAXM | WHPX | Hypervisor.Framework |
---|---|---|---|
You have an Intel Processor | X | X | X |
You have an AMD Processor | X | ||
You want to support Hyper-V | X | ||
You want to support nested Virtualization | Limited | ||
You want to use technologies like Docker | X | X |
Accelerating Android emulators on Windows
The following virtualization technologies are available foraccelerating the Android emulator:
- Microsoft's Hyper-V and the Windows Hypervisor Platform (WHPX).Hyper-Vis a virtualization feature of Windows that makes it possible to runvirtualized computer systems on a physical host computer.
- Intel's Hardware Accelerated Execution Manager (HAXM).HAXM is a virtualization engine for computers running Intel CPUs.
https://renewbg.weebly.com/download-eos-info-for-mac.html. For the best experience on Windows, it is recommended that you use WHPX toaccelerate the Android emulator. If WHPX is not available on yourcomputer, then HAXM can be used. The Android emulator willautomatically make use of hardware acceleration if the followingcriteria are met:
- Hardware acceleration is available and enabled on your developmentcomputer.
- The emulator is running a system image created foran x86-based virtual device.
Important
You can't run a VM-accelerated emulator inside another VM, such asa VM hosted by VirtualBox, VMware, or Docker. You must run the Androidemulator directly on your system hardware.
For information about launching and debugging with the Androidemulator, seeDebugging on the Android Emulator.
Accelerating with Hyper-V
Before enabling Hyper-V, read the following section to verifythat your computer supports Hyper-V.
Verifying support for Hyper-V
Hyper-V runs on the Windows Hypervisor Platform. To use the Androidemulator with Hyper-V, your computer must meet the following criteriato support the Windows Hypervisor Platform:
- Your computer hardware must meet the following requirements:
- A 64-bit Intel or AMD Ryzen CPU with Second Level Address Translation (SLAT).
- CPU support for VM Monitor Mode Extension (VT-c on Intel CPUs).
- Minimum of 4-GB memory.
- In your computer's BIOS, the following items must be enabled:
- Virtualization Technology (may have a different label depending on motherboard manufacturer).
- Hardware Enforced Data Execution Prevention.
- Your computer must be updated to Windows 10 April 2018 update(build 1803) or later. You can verify that your Windows versionis up-to-date by using the following steps:
- Enter About in the Windows search box.
- Select About your PC in the search results.
- Scroll down in the About dialog to the Windows specificationssection.
- Verify that the Version is at least 1803:
To verify that your computer hardware and software is compatible withHyper-V, open a command prompt and type the following command:
If all listed Hyper-V requirements have a value of Yes, then yourcomputer can support Hyper-V. For example:
Enabling Hyper-V acceleration
If your computer meets the above criteria, use the following stepsto accelerate the Android emulator with Hyper-V:
- Enter windows features in the Windows search box and selectTurn Windows features on or off in the search results. In theWindows Features dialog, enable both Hyper-V and WindowsHypervisor Platform:After making these changes, reboot your computer.
![Intel haxm error Intel haxm error](/uploads/1/2/6/8/126853365/751181109.jpg)
Important
On Windows 10 October 2018 Update (RS5) and higher, youonly need to enable Hyper-V, as it will useWindows Hypervisor Platform (WHPX) automatically.
- Install Visual Studio 15.8 or later(this version of Visual Studio provides IDE support forrunning the Android emulator with Hyper-V).
- Install the Android Emulator package 27.2.7 or later. Toinstall this package, navigate to Tools > Android > Android SDKManager in Visual Studio. Select the Tools tab and ensure thatthe Android emulator version is at least 27.2.7. Also ensure thatthe Android SDK Tools version is 26.1.1 or later:
When you create a virtual device (seeManaging Virtual Devices with the Android Device Manager),be sure to select an x86-based system image. If you use an ARM-based system image,the virtual device will not be accelerated and will run slowly.
Accelerating with HAXM
Use HAXM to accelerate the Android emulator if your computerdoes not support Hyper-V. You mustdisable Device Guardif you want to use HAXM.
Verifying HAXM support
To determine if your hardware supports HAXM, follow the steps inDoes My Processor Support Intel Virtualization Technology?.If your hardware supports HAXM,you can check to see if HAXM is already installed by using thefollowing steps:
- Open a command prompt window and enter the following command:
- Examine the output to see if the HAXM process is running. if it is,you should see output listing the
intelhaxm
state asRUNNING
. Forexample:IfSTATE
is not set toRUNNING
, then HAXM is not installed.
If your computer can support HAXM but HAXM is not installed, use thesteps in the next section to install HAXM.
Installing HAXM
HAXM install packages for Windows are available from theIntel Hardware Accelerated Execution Manager GitHub releasespage. Use the following steps to download and install HAXM:
- From the Intel website, download the latestHAXM virtualization engineinstaller for Windows. The advantage of downloading the HAXMinstaller directly from the Intel website is that you can be assuredof using the latest version.
- Run intelhaxm-android.exe to start the HAXM installer. Acceptthe default values in the installer dialogs:
When you create a virtual device (seeManaging Virtual Devices with the Android Device Manager),be sure to select an x86-based system image. If you use an ARM-based system image,the virtual device will not be accelerated and will run slowly.
Troubleshooting
For help with troubleshooting hardware acceleration issues, see theAndroid emulatorTroubleshootingguide.
Accelerating Android emulators on macOS
The following virtualization technologies are available foraccelerating the Android emulator: https://heavenlyevil491.weebly.com/how-to-download-torrent-movies-quickly.html.
- Apple's Hypervisor Framework.Hypervisoris a feature of macOS 10.10 and later that makes it possible to runvirtual machines on a Mac.
- Intel's Hardware Accelerated Execution Manager (HAXM).HAXMis a virtualization engine for computers running Intel CPUs.
It is recommended that you use the HypervisorFramework to accelerate the Android emulator. If the HypervisorFramework is not available on your Mac, then HAXM can be used. TheAndroid emulator will automatically make use of hardware accelerationif the following criteria are met:
- Hardware acceleration is available and enabled on the developmentcomputer.
- The emulator is running a system image created foran x86-based virtual device.
Important
You can't run a VM-accelerated emulator inside another VM,such as a VM hosted by VirtualBox, VMware, or Docker. Youmust run the Android emulatordirectly on your system hardware.
For information about launching and debugging with the Androidemulator, seeDebugging on the Android Emulator.
Accelerating with the Hypervisor Framework
To use the Android emulator with the Hypervisor Framework, your Mac mustmeet the following criteria:
- Your Mac must be running macOS 10.10 or later.
- Your Mac's CPU must be able to support the Hypervisor Framework.
If your Mac meets these criteria, the Android emulator willautomatically use the Hypervisor Framework for acceleration. If you are not sure if Hypervisor Frameworkis supported on your Mac, see theTroubleshootingguide for ways to verify that your Mac supports Hypervisor.
If the Hypervisor Framework is not supported by your Mac, you can useHAXM to accelerate the Android emulator (described next).
Accelerating with HAXM
If your Mac does not support the Hypervisor framework (or you are usinga version of macOS earlier than 10.10), you can use Intel's HardwareAccelerated Execution Manager(HAXM)to speed up the Android emulator.
Before using the Android emulator with HAXM for the first time, it's agood idea to verify that HAXM is installed and available for theAndroid emulator to use.
Verifying HAXM support
You can check to see if HAXM is already installed by usingthe following steps:
- Open a Terminal and enter the following command:This command assumes that the Android SDK is installed at thedefault location of ~/Library/Developer/Xamarin/android-sdk-macosx;if not, modify the above path forthe location of the Android SDK on your Mac.
- If HAXM is installed, the above command willreturn a message similar to the following result:If HAXM is not installed, a message similar tothe following output is returned:
If HAXM is not installed, use the steps in the next section toinstall HAXM.
Installing HAXM
HAXM installation packages for macOS are available from theIntel Hardware Accelerated Execution Managerpage. Use the following steps to download and install HAXM:
- From the Intel website, download the latestHAXM virtualization engineinstaller for macOS.
- Run the HAXM installer. https://diasupug.hatenablog.com/entry/2020/11/23/102955. Accept the default values in the installer dialogs:
Troubleshooting
For help with troubleshooting hardware acceleration issues, see theAndroid emulatorTroubleshootingguide.
Related Links
If you've been looking for a way to develop your Xamarin Android apps in a Parallels Desktop Windows VM, but run the app in an Android emulator on your Mac, this post is an attempt to distill the information from across multiple sites to get you started.
Many thanks to James Montemagno for pointing me to Paul Batum's post on the Xamarin forum.
My Configuration
- Intel MBP running OS X Mavericks
- Parallels Desktop running a Windows 8 VM
Set up your Mac
1. Download & Install the Android SDK
Nothing can get done until the Android SDK is installed, so let's start there.
Download Intel Haxm Android Studio
Install the Android SDK
You should end up with an SDK directory somewhere on your Mac with subdirectories like: extras, platform tools, tools, etc.
Yeah? -- Okay. Next.
2. Install the Intel HAXM
Intel HAXM - What?
Intel Hardware Accelerated Execution Manager. In short, it speeds up Android app emulation on Intel host machines. This step is necessary if you plan on creating custom AVDs that leverage the much faster Intel x86 images.
Install the Intel OS X HAXM Zip
Do you use OS X Mavericks + Parallels Desktop 9 ?
Install the OS X 10.9 HAXM Hotfix
If you don't do this, when you launch an Intel x86 emulator image, your entire computer will freeze up forcing you to perform a hard reboot. No one wants that.
3. Configure your Mac for SSH sharing
In OS X Go To:
System Preferences > Sharing > Enable Remote Login
System Preferences > Sharing > Enable Remote Login
Leave the other options set to their defaults.
4. Start the Android emulator
Intel Haxm Error
Several AVDs came pre-configured when you installed the Android SDK. For the sake of this tutorial, we'll use one of those devices which use ARM images. To view the configured devices, start the AVD Manager:
- Open a command line
- Navigate to the tools directory of your Android SDK: yourandroidsdkdirectory/tools
- Enter the following command:./android avd
- The AVD Manager will open
Start an Android device:
- select a device with a green check
- press Start..
- the Launch Options dialog will appear. Press Launch
Earlier, we installed HAXM which allows the use of the Intel x86 images which run much faster than their ARM counterparts. If you'd like to try those out: open the SDK Manager, download the x86 images, then configure devices in the AVD Manager to use the x86 images instead of the ARM images.
- Open a command line
- Navigate to the tools directory of your Android SDK: yourandroidsdkdirectory/tools
- Enter the following command:./android
- download the x86 images
- edit a device in the AVD Manager to use an x86 image instead of an ARM image
5. Kill the ADB Server
- Open a command line
- Navigate to the platform-tools directory of your Android SDK: yourandroidsdkdirectory/platform-tools
- Enter the following command:./adb kill-server
Okay! -- Your Mac is ready.
Set up you Windows VM
1. Start your Windows VM in Parallels Desktop
2. Download and install PuTTY SSH Client
Install the PuTTY SSH Client
3. Create a new connection to your Mac
Let's connect to the Mac.
- Start PuTTY SSH Client
- Select Session from the Category panel on the left
- In the Host Name (or IP Address) field, enter the IP Address of you Mac (found at: System Preferences > Sharing)
- Leave the Port set to its default (should be 22)
- Make sure SSH is selected under Protocol
4. Configure port forwarding
Select Connection > SSH > Tunnels from the Category panel on the left side of the PuTTY SSH Client. From here add two forwarding configurations.
First
- Source Port: 5555
- Destination: localhost:5555
- Source Port: 5554
- Destination: localhost:5554
You will be presented with a command line console. When prompted, enter your Mac admin username and password to open a connection from your Windows VM to OS X.
5. Kill then Start the ADB Server
- Open a command line
- Navigate to the platform-tools directory of your Android SDK: yourandroidsdkdirectory/platform-tools
- Enter the following command:adb.exe kill-server
- Then enter the following command:adb.exe start-server
- Confirm that your Mac emulator device has been picked up by entering the following command:adb.exe devices
- You should see a device listed something like: emulator-5554
6. Open a Xamarin Android project
Now for the big test!
Launch your Xamarin IDE of choice and open a Xamarin Android project. Once the project initializes, you should see your already running Mac emulator listed in the device dropdown.
And that's it! -- You can debug all day long from Parallels over to your Mac.
The Bonus Round - Genymotion Emulator
The AVD emulator that comes with the Android SDK is fine, but it could be better. Enter Genymotion.
The Genymotion emulator is noticably faster, but it requires some baggage: VirtualBox - which doesn't play well with Parallels Desktop 9 out of the box.
[Detailed tutorial coming soon]