I’ve always found it pretty annoying that I couldn’t run the Android Emulator and Hyper-V at the same time. Especially now a days when having Docker running is just kind of an expected part of the (my) daily development process, and the thought of disabling Hyper-V and rebooting just makes me want to put off (indefinitely) any Android work..
Anyway, the Android Emulator does now, in fact, support Hyper-V (along with, of course, haxm, which is useless to me). The steps and instructions one finds on the web are confusing, missing steps and often contradict one another. I suspect this a result of Google’s grudging support of Things Windows, which doesn’t help anyone regardless of what they might think.
The best instructions I’ve found are here:
Even after getting everything set up though, the Android Virtual Device Manager displays a bogus warning:
Your CPU does not support required features (VT-x or SVM)
Which, of course, it does.
The solution, as neatly laid out in the linked page, is to explicitly launch the emulator from the command line. So, assuming my installation of the Android SDK is in C:\Program Files (x86)\Android\Android-sdk, I can list my AVDs with the command:
C:\Program Files (x86)\Android\Android-sdk/emulator/Emulator -list-avds
and I can launch a particular AVD using the command:
C:\Program Files (x86)\Android\Android-sdk/emulator/Emulator -avd <avd_name> -partition-size 512 -feature WindowsHypervisorPlatform
Which neatly launches the emulator, making use of Hyper-V. It still seems slightly slower than running using haxm, but it’s infinitely better than the alternative of no hardware acceleration at all.