Intel HAXM on macOS high sierra (10.13) - android

Is there any way of using Android emulator on High Sierra (10.13)?
When I run
./HAXM\ installation -u
It says:
HAXM silent installation only supports macOS from 10.8 to 10.12 !

The command line installation doesn't work and gives unsupported mac os version error, while the installation through IntelHAXM_6.2.1.mpkg works but kext is not loaded due to "Approved Kernel Extension Loading" changes,
So you will need to allow the extensions from Intel and restart your mac,
then launch the emulator like from inside Android Studio,
To enable go to System Preferences > Security & Privacy as shown in the screenshot:

I was able to install Intel HAXM drivers on my Mac using the instructions provided in this post. There might be other (better) solutions to this, but I have successfully managed to start the emulator this way. Essentially you need to disable the security protection on kext before trying to install the HAXM drivers.
This command will only work on Recovery OS, which means that you need to restart your Mac and hold command + R until the Apple logo is displayed. Next, you need to go to Utilities > Terminal and run:
csrutil enable --without kext
Then restart your Mac and log in, go here to download the latest Intel HAXM driver. Unzip if needed, edit the silent_install.sh file and search for the 10.12 OS version. You will find it on the line which should look like this
for v in 10.8 10.9 10.10 10.11 10.12
You need to add the 10.13 version after 10.12 (separated by space, just like the rest). Save the file and open a Terminal at this location. Run ./silent_install.sh and that should be it. To be sure it works, you can also run sudo kextload -bundle-id com.intel.kext.intelhaxm.
Now your emulator should work.
In order to re-enable the kext security protection, you need to restart your Mac in Recovery OS, open a Terminal window and run csrutil enable.

Intel Corporation just fixed it and released HAXM for macOS Sierra and macOS High Sierra, just download the ZIP and execute the .dmg file, then restart Android Studio. It worked for me, hope it works for you too.
Intel Link for the download : https://software.intel.com/en-us/android/articles/intel-hardware-accelerated-execution-manager-end-user-license-agreement-macosx

Use the new Hypervisor.Framework support on macOS.
Add this line in ~/.android/advancedFeatures.ini (create this file if it doesn't exist already).
HVF = on
Issue answered here:
https://issuetracker.google.com/issues/62395878#comment7
That's worked for me.
Also you can be updated with Intel HAXM as they fixed this error.
Download HAXM latest version here (Restart macOS Required):
https://software.intel.com/en-us/android/articles/intel-hardware-accelerated-execution-manager-end-user-license-agreement-macosx
Hope it help.

To verify that Intel HAXM is running, open a terminal window and execute the following command:
kextstat | grep intel
If Intel HAXM is operating correctly, the command will show a status message indicating that the kernel extension named com.intel.kext.intelhaxm is loaded.
Try to stop and stat again HAXM., than verify it works correctly.
To stop Intel HAXM, use the following commands:
sudo kextunload -b com.intel.kext.intelhaxm
To start Intel HAXM, use the following commands:
sudo kextload -b com.intel.kext.intelhaxm

You can use Google's 6.2.1's silent_installer.sh to properly install HAXM on High Sierra:
https://dl.google.com/android/repository/extras/intel/haxm-macosx_r6_2_1.zip
Otherwise use Android Studio's SDK Manager to download and install it for you:
This was not introduced until 6.2.1(Google Distribution only) which looks like a hotfix from the 6.2.0 version which would throw the following message:
HAXM silent installation only supports macOS from 10.8 to 10.12!
If you don't want to use HAXM, you can use the Hypervisor.Framework by ensuring you have installed Android Emulator 26.1.3
Documentation
The emulator is now fully compatible with macOS 10.13 High Sierra through either Hypervisor.Framework or HAXM 6.2.0.
https://developer.android.com/studio/releases/emulator.html#26-1-3

Try using Hypervisor.Framework as mentioned in this post.
https://issuetracker.google.com/issues/62395878

If you have already installed the latest Intel HAXM Manager (v6.2.1) then re-install it and restart your computer. It will fix the emulator problem. You will be able to run emulators again. Here is the link:
https://software.intel.com/en-us/articles/intel-hardware-accelerated-execution-manager-intel-haxm

Download this https://software.intel.com/en-us/android/articles/intel-hardware-accelerated-execution-manager-end-user-license-agreement-macosx
and install .dmg then restart pc.This worked for me.

I had to go to System Preferences > Security & Privacy, click the unlock button, and a message will pop up asking to allow Intel to run. After that, HAXM ran on High Sierra.

very specific case: if you keep android studio and sdk in separate partitions, and then you moved sdk to newly formatted partition, then in my case only uninstalling android studio and reinstalling it with new sdk is helped. sad story..

Related

Android Studio Emulator is not working on Windows 11 when WSL2 is installed

Setup:
Windows 11 Home 21H2 22000.132
AMD Ryzen 5900X
WSL2
Android studio lastest build (also tried with latest beta)
Problem:
As soon as I install WSL2, the emulator stops working. It's giving the following error message:
C:\Users\gusta\AppData\Local\Android\Sdk\emulator>emulator.exe -avd Android_TV_1080p_API_300
emulator: Android emulator version 30.8.4.0 (build_id 7600983) (CL:N/A)
handleCpuAcceleration: feature check for hvf
added library vulkan-1.dll
Failed to open /qemu.conf, err: 2
C:\Users\gusta\AppData\Local\Android\Sdk\emulator\qemu\windows-x86_64\qemu-system-x86_64.exe: WHPX: Failed to setup partition, hr=c0350005
C:\Users\gusta\AppData\Local\Android\Sdk\emulator\qemu\windows-x86_64\qemu-system-x86_64.exe: failed to initialize WHPX: Invalid argument
Using WSL2 at the same time as the android emulator was working before on an Intel i7 4770k processor, but stopped working after a processor upgrade to a AMD Ryzen 5900x and fresh install of Windows 11.
For clarification: I'm not trying to run the emulator from WSL2, I'm trying to run it from Android Studio. When trying to start it from Android Studio it never launches, when trying to run it from the Windows Command Line I get the above error.
The "Failed to open /qemu.conf" is possible to solve by creating that file manually, as explained by this answer. That however doesn't fix the two later errors with WHPX.
I've followed the official instructions on this page (Following the AMD with Hyper-V option WHPX). I think the problem has to do with Hyper-V running which WSL2 is using if I'm not misstaken. But according to the above link it should be possible to run the emulator at the same time as Hyper-V using WHPX. I've also tried using the Android Emulator Hypervisor Driver for AMD processors, which is giving me the exact same result.
Activated Windows features:
Thankful for any help, and please tell me if I need to add more information
Newer Answer
I found and tested in shorter toggle mechanism.
The configuration for Windows Feature:
Windows Subsystem for Linux is installed.
Windows Hypervisor Platform is installed.
Hyper-V is installed.
If you need the Emulator, you only need to turn off Hypervisor + Restart. Run: bcdedit /set hypervisorlaunchtype off
If you need the Docker back, you can run the hypervisor hence disabling Emulator. Run: bcdedit /set hypervisorlaunchtype auto
You need to restart after setting Hypervisor
You cannot run both at the same time. Another forum worth checking in How about running docker? in my older answer below.
Older Answer
I think I solved this issue, tested to run from CMD / Android Studio and ran perfectly as before installing WSL. There are several step we go:
Configuring Windows Feature:
Removed Windows Subsystem for Linux
Removed Windows Hypervisor Platform
Removed Hyper-V
Here is my current setup:
Reverting AVD setup
I know after removing there are some odds because the AVD still get the same error as before and expected to get into WSL. I stumbled and found something when ran:
C:\Users\[NAME]\AppData\Local\Android\Sdk\emulator\emulator-check.exe accel
That command will check the current accel. It explains that the Hypervisor need to be set off and give specific help:
run bcdedit /set hypervisorlaunchtype off.
After running the bcdedit, I restarted and all is reverted. Now I can run emulator both from CMD and Android Studio perfectly.
How about running docker?
Sad truth, yeah you cannot run both pararel. There are several workaround in this forum:
How can I run both Docker and Android Studio Emulator on Windows?
Several option ranging from changing emulator, add & remove docker when in need using above step, created nested vm, etc. My personal choice right now is using another Emulator for the time being and removed docker for the latter.
I finally got this working using this fix (answer number 48). Seems like a valid workaround until windows fixes this issue. I downloaded the compiled version for windows and moved it to my emulator path C:\Users\<username>\AppData\Local\Android\Sdk\emulator. Seems to be versions available for linux and mac as well but I haven't tested those.
This issue is tracked by Google bug https://issuetracker.google.com/issues/202188690
This problem only occurs with AMD processors, I have two systems both with WSL2 and Docker running on the latest Windows 11 (Insider Beta) build. One with an AMD Ryzen 5950 and one with an Intel i7-8086K.
On the Intel system the emulator runs fine with hardware acceleration together with WSL2 and Docker.
On the AMD I run into the same error when running the emulator with hardware acceleration. In the Windows 10 Insider builds before Windows 11 it still worked.
A very similar problem was introduced before in Windows 10 build 10.0.21292
and later fixed in build 21327. (https://github.com/microsoft/WSL/issues/6471) But this problem affected both Intel and AMD.
I haven't tried to turn off the AMD fTPM yet, as this is the only other change apart from updating Windows 10 Insider (dev ring) to Windows 11.
The Android Emulator Hypervisor Driver for AMD processors only works when the Windows Hypervisor is disabled, it's not used for WHPX.
The Windows Feedback is full of reports of this problem, please upvote them.
Android Studio emulator doesn't support run Hyper-V on Windows 11, we can disable Hyper-V to run but if we do that applications which require Hyper-V to run like WSL2, Docker then fail to run.
While waiting Google update Android Studio emulator support Hyper-V we have a workaround solution to run both by using another emulator which support Hyper-V like Bluestack 5 version "Nougat 64 bit (Supports Hyper-V)" at the link below
https://www.bluestacks.com/download.html
If you did all of those steps and still you are facing that emulator termination issue, then please upgrade or download your graphic card drivers and install it. After I installing Windows 11 this issue happened to my android studio emulator. Lot of steps I followed but nothing work. after that I checked my Graphic card drivers and install it. Now emulator working fine...

How to run HAXM on Mac OSX Hight Sierra

I have just updated my OSX to High Sierra. Since then My android Emulators don't run! I have deleted all the old emulators and created a new one. But it is too slow. It seems HAXM is disabled right now!
How can I enable and run HAXM?
HAXM is supported until mac OS 10.12. They have not support for mac OSX 10.13 yet.
Supported Operating Systems:
Mac* OS X* 10.10 (Yosemite) or higher, up to macOS* 10.12 (Sierra)
check here for more
1- Go to Recovery Mode by restarting and holding down ⌘+R until Apple logo appears.
2- In the top menu click Utilities > Terminal.
3- In the Terminal window type and press Enter:
csrutil enable --without kext
Then you can install HAXM from:
Download the driver from here and unzip it.
Open a terminal and go to the directory of the driver :
cd Downloads/haxm-macosx_v6_2_0
# edit the file and look for 10.12
Add 10.13 after 10.12, and save the file
Run it :
Make sure it works :
sudo kextload -bundle-id com.intel.kext.intelhaxm
See this post
here

/dev/kvm is not found on Mac OS

I recently updated my Macbook pro to Mac OS High Sierra. Now I'm running into an issue where I can no longer start the emulator in Android Studio.
The warning /dev/kvm is not found. is shown. When I tried to start the emulator I get the following error:
I tried different versions of Intel HAXM from the SDK manager and standalone, reinstalling Android Studio and completely removing all configurations, still the same issue..
Go to:
System Preferences > Security & Privacy > General
There should be a message like “System software from developer xxx was blocked from loading.”
Click Allow
To use VM acceleration on a Mac, you must install the Intel HAXM kernel extension to allow the emulator to make use of CPU virtualization extensions. Android Studio requires Mac OS X 10.8.5 or higher, up to 10.11.4 (El Capitan) Mac OS X; the kernel extension is compatible with Mac OS X 10.6.0 and higher.
To install the Intel HAXM kernel extension, follow these steps:
Open the SDK Manager.
Click the SDK Update Sites tab and then select Intel HAXM.
Click OK.
After the download finishes, execute the installer.
For example, it might be at this location:
sdk/extras/intel/Hardware_Accelerated_Execution_Manager/IntelHAXM_version.dmg.
To begin installation, in the Finder, double-click the IntelHAXM.dmg file and then the IntelHAXM.mpkg file.
Follow the on-screen instructions to complete the installation.
After installation finishes, confirm that the new kernel extension is operating correctly by opening a terminal window and running the following command:
kextstat | grep intel
You should see a status message containing the following extension name, indicating that the kernel extension is loaded:
com.intel.kext.intelhaxm
Reference
It seemed to be an Intel HAXM issue. I resolved it by completely removing Intel HAXM.
Then I followed this guide, which basically makes you edit the install script of HAXM so the silent installation will work on Mac OS High Sierra.
I found the answers provided by #AresDev & #ShubhamJain to be super helpful for the uninstallation & re-installation of HAXM, but in my case it still didn't resolve the /dev/kvm not found errors I was seeing. My Mac OS High Sierra was blocking the AVD / Intel extensions from running correctly, and I had to Allow it under System Preferences > Security & Privacy > Allow.
However, the Allow button doesn't respond in some situations! I had to quit Google Chrome, before could click Allow, as described in these posts: "Github Karabiner Elements Issues"

AVD emulator not working on android studio 2.3.3

Ive just installed Android studio on my ubuntu machine and I cant get the emulator to work
Looking at similar questions i ran the commands sudo apt-get install lib64stdc++6:i386 and sudo apt-get install mesa-utils
but in the directory /Android/Sdk/emulator the folder lib64 doesn't even exist ( which it should according to all the other answers)
Another Solution that was given was to go to The AVD manager and to then set the emulated performance to software but as shown below that option is greyed out in my machine
Picture of emulated performance greyed out
Thanks in advance
Reboot to your BIOS and enable Intel HyperV or Virtualization Technology whatever is listed there. AVD requires virtualization to be enabled from BIOS to take advantage of performance enhancements provided. So enabling Virtualization Technology would surely enable Emulated Performance.

Intel HAXM installation Failed

I installed HAXM using Android SDK and it gave me an error of Not Installed while building. On maual installation, I get the following error. Can anyone help to figure out this?
Last login: Sun Jul 19 21:44:03 on ttys000
Tikas-MacBook-Pro:~ user$ /Users/user/Downloads/haxm-macosx_r05/HAXM\ installation ; exit;
2015-07-19 21:56:46.472 HAXM installation[779:65674] AuthorizationExecuteWithPrivileges failed with return: -60031
2015-07-19 21:56:46.472 HAXM installation[779:65674] HAXM installation failed!
logout
Saving session...completed.
[Process completed]
I just ran into this problem as well. I'm running Yosemite so the downgrading solution isn't pertinent. Eventually I decided to try running the silent_install.sh that's in the same dir as HAXM installation, and it worked.
Details
Open terminal window. (/Applications/Utilities/Terminal)
sudo ~/Library/Developer/Xamarin/android-sdk-macosx/extras/intel/Hardware_Accelerated_Execution_Manager/silent_install.sh
when prompted, enter sudo password.
wait a minute - says "Silent installation Pass!".
To verify success:
Open Google Android Virtual Device (AVD) manager.
Create a virtual machine with x86 or x86_64 as architecture.
Start that virtual machine - says "HAX is enabled", and Android Emulator window opens showing the emulated device.
NOTE: This answer is obsolete. Use adamvert's answer.
For anyone coming here, Preview Versions of Max OS X like El Capitan do not completely support all apps like the HAXM
Downgraded to Yosemite and it worked.
if the reason is that you upgraded to High Sierra 10.13 masOS
then : Do this on your own responsibility as I am not sure that it has no side effects
Download the HAXM-maxosx_v6_2_1
open the file silent_install.sh
go to the line :
for v in 10.8 10.9 10.10 10.11 10.12
add to it 10.13 if your os is High Sierra 10.13.xx
so it will be :
for v in 10.8 10.9 10.10 10.11 10.12 10.13
then run the silent_install.sh file as sudo
then it will pass :)

Categories

Resources