Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to run Android Device Emulator (via Android Studio 2) on VMWare?

I have been running Android Studio 1.5.1 doing development on a WMWare copy of Windows 2012 R2 and everything works fine. I've been able to run the device emulator with no problems and start various versions of Android running in AVD.

Android Studio 2.x Change I recently installed Android Studio 2.0 (see image below for exact version).

Android Studio Version Info

Now when I attempt to run the emulator nothing happens. Well, actually I do see a message in the status bar of Studio when I attempt to start the device, but then that message disappears and nothing happens after that.

starting...

There is a warning that I need to turn off Hyper-V (see image below), but I don't believe that is possible since this is a VM.

No Longer Possible?

Is it not possible to run the emulator on the VM any more?

turn off Hyper-V

like image 758
raddevus Avatar asked Apr 19 '16 20:04

raddevus


People also ask

Can I run Android emulator on VMware?

You can't run a VM-accelerated emulator inside another VM, such as a VM hosted by VirtualBox, VMware, or Docker (unless using WSL2). You must run the Android emulator directly on your system hardware.

Can you emulate Android with Android Studio?

The Android Emulator enables you to test your app on many different devices, virtually. The emulator comes with Android Studio by default, so you shouldn't have to manually install it. The basic workflow with the emulator goes as follows: Verify that you have the system requirements.

Can we install Android Studio in virtual machine?

By default, Google Cloud blocks the ability to create nested virtual machines, so Android Studio runs, but you can't run an AVD using the emulator.


3 Answers

More recent versions of the Android Emulator require hardware virtualization support (Intel HAXM).

Unfortunately, most virtual machines do not provide HAXM instructions to the guest (a VM within a VM), so you will be unable to use the emulator within the virtual machine.

like image 181
Tom Mettam Avatar answered Oct 17 '22 01:10

Tom Mettam


I just installed Android Studio 2.1 on my Windows 2008 R2 VM (running VMWare) and I'm happy to report that it is possible to run ARM based AVD (Android Virtual Devices) on the VM.

Steps To Run Arm-based Virtual Device on VMWare

  1. Go to location where you've installed the Android SDKs (in my case it is at %appdata%\Android2\SDK\
  2. If you are in the right place you should see a directory structure and directories like the ones shown in the first image below.

sdk dir

  1. Start the AVD.exe by double-clicking it.

You will see a window like the one in the image below avd manager

  1. Take a close look and notice that this is running an ARM(armeabi-v71) image. When you download images you have to download ARM-based images. (no x86 images will work on VM).

  2. Also, you cannot start these images from AVD that launches from Android Studio 2.x

  3. Make sure you have an environment variable named ANDROID_SDK_HOME set to path which is similar to the one at the top of the AVD manager (in image).

Once you do all of this and start an ARM-based image on a VMWare VM it will warn you that it is faster with HAXM but at least the image will run.

Finally, you can see if you attempt to launch your Virtual Device from the AVD Manager in Android Studio then it will warn you that Hyper-V needs to be turned off. Of course you cannot turn Hyper-V off on a VM.

enter image description here

EDIT -- Running Android 7 ARM Image

@mcflysoft asked about running an android 7 ARM image. At first I didn't think it worked, but if you open up your SDK manager and install the exact ARM OS image shown in the following picture, it will run on a Windows VM: android 7 arm

ARM image Containing Google APIs

I tried installing the ARM image that contained the Google APIs and that one would not ever start. There were failures logged which I could see in c:\> adb shell logcat.

Beware : It Is Really Slow

However, running Android 7 seems extremely slow and I don't see a web browser. Not sure how helpful it may be to you, but you can get it working. Good luck.

android 7 running

like image 27
raddevus Avatar answered Oct 17 '22 01:10

raddevus


The simplest solution I've found so far is to use a device farm, for example Samsung's device farm: https://developer.samsung.com/remotetestlab/galaxy/rtlDeviceList.action#444

It's free to use and you can deploy your apps just like in an emulator (Right Click -> Test -> Remote Debug Bridge -> follow the instructions).

And since those are real devices, the speed might be even better than on an emulator on your personal PC.

like image 2
user3673952 Avatar answered Oct 17 '22 01:10

user3673952