How do I execute tests on Android Emulator that exist on VM?

Currently when I run a test on a VM it opens the chrome browser correctly, but it doesn’t open the android emulator.

androiddriver = new AndroidDriver(new URL(“http://[VM IP]:”+strAppiumPort+"/wd/hub"), capabilities);

Error Connect to [VM IP];4728 failed: Connection refused.

Doesn’t look like it matter. You cannon run emulator within a VM.

I have not found a way to run an Android Virtual Device emulator on a virtual machine. The x86 images seem to require hardware virtualization support (Intel HAXM).

You either have to run the ARM version of the emulator, which I have found to be painfully slow, or run your emulators on physical hardware.

1 Like