Using Hyper-V and Visual Studio with Android x86 KitKat v4.4

Androidx86 is a project hosted on http://www.android-x86.org/. The purpose of the project is porting Android open source project to x86 platform, formerly known as “patch hosting for android x86 support“. The original plan is to host different patches for android x86 support from open source community.

Developers can actually use Hyper-V hosted Android x86 for testing and app development. Hyper-V is built into Windows 8.x and works much faster than Android emulators. In this walkthrough which requires about 10-15 minutes we’ll set up Android x86 in Hyper-V and deploy a Visual Studio Xamarin app to the virtual machine.

Overview

1. Deploy Android x86 in Hyper-V (3 minutes)
2. Deploy your APK from ADB or Visual Studio

Setting up Android x86 on HyperV

Installing Android x86 on Hyper-V is very easy: you create a VM, download Android x86 ISO from http://www.android-x86.org/download and install Android in your VM, like a regular Linux distribution. I used the latest KitKat version: android-x86-4.4-r1-iso Below are step-by-step instructions.

clip_image002

1. Start Hyper-V manager (in Windows 8.x Window-Q Hyper V), then create a new VM in Hyper-V Manager (New / Virtual Machine…)
clip_image004

2. Download Android x86 ISO from http://www.android-x86.org/download

3. Attach ISO to your VM (Media/DVD Drive/Insert Disk…) and select Android x86 ISO

4. Set up Android as you would a Linux distribution: it’ll prompt you to create and format a partition, install GRUB boot loader etc.

clip_image006

clip_image008

clip_image010

clip_image012

5. After the installation, Android x86 runs in your VM. You can now eject the ISO and let the Android boot.

Developing apps using Android x86 in Hyper-V

Android x86 running in Hyper-V is no different from any other Android device or emulator for ADB or Visual Studio. First we need to unlock Android x86 instance for development, then connect our Windows PC to it.

1. In Android x86 press Alt-F1 for command prompt, then type netcfg, which will give you an IP, e.g. 192.168.1.10, press Alt-F7 to go back to graphics shell

2. In Windows PC start ADB command prompt (provided with Android SDK) and type:

adb connect 192.168.1.10

3. If you use Visual Studio for development, for example for Xamarin apps, you can now select Android x86 virtual machine running in Hyper-V

clip_image013

4. Now you can deploy your APK from any file with adb install… or from Visual Studio directly to Android x86 emulator in Hyper-V.