Trying Out Android Automotive

Learn how to build and run on emulator Google’s Android for in-car infotainment

Ilyas Hamadouche
3 min readOct 19, 2020
Polestar 2 is the first car to use Android Automotive OS to power its infotainment system (Photo by Steven Binotto on Unsplash).

In March 2017, Google announced a new Android variant, called Android Automotive, designed for in-vehicle infotainment (IVI). It’s a full Android operating system that is installed and run on the car’s hardware. That is the same Android that powers your smartphone, will be shipped in cars.

In February 2018, Volvo’s electric brand, Polestar, announced they will use Android Automotive on their car Polestar 2. The car was released this year (2020). Different companies, like Renault–Nissan–Mitsubishi Alliance, General Motors, and Groupe PSA, reported that they will use the system also in their upcoming cars [1].

Fortunately for us, developers, Google made the Android Automotive source code open-source. In this article, I’ll show you how to get, build, and run the system on the emulator.

Installing dependencies

First, we need to install the required tools and packages for the build. Please open a terminal and run:

~$ sudo apt-get update
~$ sudo apt-get install android-tools-adb bc bison build-essential curl flex g++-multilib gcc-multilib git gnupg gperf imagemagick libncurses5 lib32ncurses5-dev lib32readline-dev lib32z1-dev liblz4-tool libncurses5-dev libsdl1.2-dev libssl-dev libwxgtk3.0-gtk3-dev libxml2 libxml2-utils lzop openjdk-8-jdk pngcrush python rsync schedtool squashfs-tools xsltproc yasm zip zlib1g-dev

Repo tool is also needed:

~$ curl https://storage.googleapis.com/git-repo-downloads/repo > /tmp/repo
~$ chmod a+x /tmp/repo
~$ sudo mv /tmp/repo /usr/bin/repo

Getting source code

Android Automotive source code is part of the Android Open Source Project (AOSP). This is the repository that contains code needed to create variant Android operating systems. Companies take the AOSP and extend/customize it according to their needs, for example, changing the look or adding support to a new sensor.

Every time Google releases a new Android version, the AOSP gets updated as well. The latest version when writing this is 11.

To fetch the AOSP, type on the terminal:

~$ mkdir android
~$ cd android
~/android$ repo init -u https://android.googlesource.com/platform/manifest -b android-11.0.0_r3
~/android$ repo sync

Note: This will consume ~50GB of free space.

Build Android Automotive

To start the build run:

~/android$ source build/envsetup.sh
~/android$ lunch aosp_car_x86_64-userdebug
~/android$ m

Note: The build may take a couple of hours. You need ~250GB of free space and ≥16GB of RAM. Tested on Ubuntu 20.04.

Run Android Emulator

After the build, emulator images are created in: out/target/product/generic_x86_64

To run the Android emulator, simply type:

~/android$ emulator

The following are some screenshots taken for the system:

Screenshot #1: Android splash screen.
Screenshot #2: Home screen.
Screenshot #3: List of installed apps.

You can specify how much RAM and CPU cores to dedicate to the emulator. The below command will start it with 6GB of RAM and 3 cores:

~/android$ emulator -memory 6144 -cores 3

To see all the available options type:

~/android$ emulator -help

This is the end of the article, I hope you enjoyed it. In case you have time and a powerful PC, don’t hesitate to try Android Automotive OS by yourself!

Share the story to spread knowledge ;)

About me

I am Ilyas Hamadouche, a Senior Software Engineer at Elektrobit Automotive. I am interested in automotive software, embedded systems, and computer vision. Follow me on Twitter and LinkedIn.

--

--