I do my android development under a Ubuntu Virtual Machine for ease of use with GIT and Gradle. However I am unable to run the Genymotion Emulator within this virtual machine as the Oracle virtual box hypervisor is problematic under a VMware virtual Machine.
To overcome this problem I have configured the Genymotion Emulator to use the ADB (Android Debugger) over Wi-Fi. The emulator runs in the windows host and interfaces to the Ubuntu development VM using the virtual network.
Setting up the Genymotion Emulator
The steps are:
- Configure a second network interface as a bridge
- Install Google Play
- Install an ADB over WIFI application
After installing the Genymotion/VirtualBox bundle under windows execute Virtual Box
Select Settings and configure Adaptor 2 as shown. The adaptor will be configured as a Bridged Adaptor. Select a physical interface that has connectivity to the development machine. In my case I am using the WIFI interface as it provides connectivity between the emulator and the VMware Host OS (since it is the DHCP client of my router)
Enable debug via usb by switching on developer options. Developer options are enabled from Settings->about tablet by tapping the build number 7 times.
From developer options select debug via usb
We need to install Google Play so that a suitable USB over WI-FI application can be sourced.
Download the gapps rom for the version of Android. I use AndroidFileHost.com https://www.androidfilehost.com/?fid=23311191640114013
This can be installed by simply dragging the file onto a running Genymotion emulator
Follow the prompts and reboot
Now use Google Play to download an ADB to WIFI application. I have found the best results using ADB Wireless Pro as it is easy to quickly enable and disable and allows switching back to usb based adb if required. Install ADB Wireless Pro and grant Superuser access.
Check that adb over WI-FI is enabled. Make note of the ip address reported. In this case it is 192.168.1.160
replace this with your IP address when running the adb commands.
The Emulator is now ready to connect with the developer machine.
For the development machine enter the command “adb connect 192.168.1.100”. Adb listens on port 5555 by default.
If required the port can be changed on the emulator via the ADB wireless pro menu.
Example of a successful connection below
To disconnect the debugger from the emulator use the “adb disconnect 192.168.1.160”
Finally Desktop snapshot with an Emulator being controlled from a Ubuntu Development VM. Enjoy you sick puppies