How To Run Android Auto In Ubuntu (Virtual Machine)

Required Knowledge:

To Run: Ability to follow these instructions, create a Virtual Machine, use a command line interface, and basic understanding of git and bash shell scripting. To Develop: At least one or more of: C, C++, JavaScript, Linux/Bash Scripting, Android, gstreamer(0.10 & 1.0).

Required Hardware:

Part 1: Virtual Machine

If you already know how to do this or are already on Ubuntu/Linux skip to part 2 These are instructions for Windows 10 and Ubuntu 16.04(64-bit) but any recent Mac OS and Linux distro should work just as well.

- Create an Ubuntu (Linux) Virtual Machine and boot up Linux with a disk image from the link above

- Give plenty of allowed RAM and Disk Space (you can use VDI Virtual Disk Image) and complete the installation

- While the installation is running, you can set up your USB devices (phone and Bluetooth) to connect automatically in settings>USB. When adding a device erase all entries except for name, Vendor ID, and Product ID (you can delete Product ID field too if your phone is having issues reconnecting). Then after they are set up disconnect them until the installation is finished and the system reboots.

- When Ubuntu is finished installing, try connecting your USB devices. In the menu under devices>USB there should be a check mark next to your Bluetooth receiver and phone. If there isn’t try to connect them, if you are getting an error you might need to fix your drivers like I did. I had to do this to get my USB devices to work Method No. 2

- By now you should have a fully functional Ubuntu Virtual Machine running with working USB drivers to use your devices.

Part 2: From 0 to AA

Once Ubuntu is all set up this is the complete set of commands to take you from 0 to Android Auto in about 30-60 minutes:

Now you have the Android Auto Ubuntu Emulator Installed, every time you want to open the emulator back up you just enter the command:

sudo ~/headunit/ubuntu/headunit

To compile a headunit binary for use in the car run:

cd ~/headunit/mazda && make clean && make

I hope this will lead to more programmers who did not want to bother installing a new operating system or spend a lot of time figuring out how to set up the development environment and whatnot to contribute to the Android Auto project. I tried to make these instructions as simple, clear, and straightforward as possible but if there are any ambiguities or you have an improvement or suggestion for this tutorial shoot me an email. To all my fellow HaXors out there Happy Hacking! NOTES: You may need to manually reconnect your phone if it is disconnected by AA. You need to have your phone in MTP mode (you can try PTP as well) to make the adb connection properly. if you are having trouble connecting you may be using an incompatible Bluetooth receiver.

AA Headunit app repository:
<//github.com/gartnera/headunit.git>

These are the dependencies:
<//github.com/gartnera/headunit/tree/master/ubuntu>

Your browser does not support the video tag.

BONUS

Now that you have Ubuntu set up and the Mazda arm toolchain installed you can also compile and run the CastScreen-Receiver: