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

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...

Origins

So, here we go again... This is the obligatory first post to mark the start of yet another social channel.  Like my Flickr  and YouTube  accounts I don't really know what I'm going to document or share here.  Chances are there'll be Coding, Cooking and Photography for starters but I imagine all sorts of randomness will pop up.  Although whatever happens I'm sure it will fare better than my Tumblr efforts! One thing for sure is this won't be a regular thing - so if you're reading this then don't hold your breath for the next instalment!