Skip to main content

Android Studio: AVD Emulator with HAXM and Docker or Virtualbox at the same time

TL;DR - if you are having problems running the Android Emulator and Docker at the same time check that you actually have the latest version installed and don't rely on what the SDK Manager is reporting


Recently I've been having a problem developing Android Apps on a Mac using Android Studio whereby when I try and start an AVD nothing happens.  Not a blank screen, not a crash, not a 'stuck at the Android logo' just nothing.  The trouble started as soon as I installed Docker for Mac alongside Virtualbox.

I noticed that even when I wasn't actively using a container but had Docker itself running I experienced this problem but if I quit Docker the problem went away.  Turns out there's an issue with earlier versions of Intel HAXM and other virtualisation technologies playing nicely together.  The usual fix in these circumstances in to check you have the latest version installed - a quick check in the SDK manager would suggest I did.  However, turns out despite the SDK manager reporting that the update has been installed, it has not - the 'installed' status simply means that the update has been downloaded and sits on your local storage.

Confirming what HAXM version you actually have installed


Within Android Studio go Tools > Android > SDK Manager and select the 'SDK Tools' tab.  Look through the list to find 'Intel x86 Emulator Accelerator (HAXM installer)' and check the version column to see what version has been downloaded.  If necessary then update it here to download the latest version.

SDK Manager suggesting HAXM 6.2.0 is installed and in use



The best way to check what version is actually running is to drop in to a terminal and run the command emulator-check accel located at <sdk dir>/tools

You should get output along the lines of:

Confirmation that it is actually version 6.0.5 that is being used


As you can see this is not as up to date as Android Studio is reporting.  To actually install the downloaded copy navigate to <sdk dir>/extras/intel/Hardware_Accelerated_Execution_Manager and run HAXM installation.  Once done run the check command again to confirm things have been updated, hopefully getting a result similar to:

Update to 6.2.0 confirmed as successful 


Note that the install is 'silent' so depending on the speed of your machine (it can take a while) it might look like it has hanged at first.  Now the final check that all is well:

Docker and Android Emulator running at the same time


Result: Docker and Android Emulator finally happily co-existing :)



Comments

Popular posts from this blog

Using Microsoft Visual Studio Code and Github together

I'm currently trying to learn Python using the excellent resources at  https://learnpythonthehardway.org/book/  and, in a move that I'm sure would enrage the author, I want to use Microsoft's Visual Studio Code as my editor.  The reasons for this are mainly that a. I actually quite like it and b. I already use it for a number of other projects.  If you haven't already then I suggest checking it out by downloading it  here . When I'm developing or learning new stuff I tend to find myself moving between a variety of systems in different locations including but not limited to an iMac, a MacBook, a Windows desktop and a Linux laptop as well as a few other bits and pieces.  This is another reason I went with Code - it works the same across all my platforms.  One thing that annoys me is when I have been working on one machine and want to seamlessly pick up on another with everything nicely synced.  Some time ago, due to wanting to answer the need...

Android Development - Udacity Capstone

I'm currently working my way through the Udacity Android Nanodegree and, way later than planned, I'm finally on the last project.  Overall the course has been good and it has been interesting watching it develop as I have been working through it.  One downside is that the course fees are paid monthly, so for each month that you are on the course you hand over another chunk of money.  If you have lots of spare time and can work uninterrupted then it could be seen as a major bonus - get the course completed quickly and it actually works out pretty cheap compared to other courses.  However, if like me things like work and life in general have got in the way then you'll see one month after another roll past and you'll realise it has actually cost you a pretty penny.  Oh well. Anyway, here I am, finally(!) on the final half of the final project.  This project is down as a Capstone with the idea being that you create one app that displays everything you have l...