Running car-emulator (Android Automotive)

2,097 views
Skip to first unread message

Kiran Rao

unread,
Sep 22, 2017, 12:17:43 PM9/22/17
to android-porting
I'm trying to build Android Automotive from source. I'm able to successfully build it using the following commands:

repo init -u https://android.googlesource.com/platform/manifest -b android-8.0.0_r11
source build/envsetup.sh
lunch car_emu_x86_64-userdebug
make -j8 V=1 &>> make.log

My question is how do I run the emulator? After googling and going through some stackoverflow posts, I came across this:

First, I set an env variable in the command-line (The emulator uses this to determine which emulator to launch)

export ANDROID_PRODUCT_OUT=/path/to/build_root

Next, I created a file car-emulator.sh and put this in it
#!/usr/bin/env bash

ANDROID_BUILD_OUT=/path/to/build_root/out
PREBUILT=/path/to/build_root/prebuilts
EMULATOR_OUT=${ANDROID_BUILD_OUT}/target/product/car-x86_64

${PREBUILT}/android-emulator/linux-x86_64/emulator \
    -sysdir ${EMULATOR_OUT} \
    -system ${EMULATOR_OUT}/system.img \
    -ramdisk ${EMULATOR_OUT}/ramdisk.img \
    -data ${EMULATOR_OUT}/userdata.img \
    -kernel ${PREBUILT}/qemu-kernel/x86_64/kernel-qemu \
    -scale 0.7 \
    -memory 512 \
    -partition-size 1024


I also tried to download the relevant (darwin-x86_64) files from the build machine to my Mac laptop and tried running there. The emulator starts but crashes immediately.

Also, I see that the CarService.apk has been generated. Is it sufficient to install this APK on a device for it to work? Does it depend on anything else?

Mayank Agarwal

unread,
Oct 27, 2017, 10:55:04 AM10/27/17
to android-porting

Hi Kiran, were you able to find any solution to this?

Renjith Rajagopal

unread,
Feb 24, 2018, 1:49:34 PM2/24/18
to android-porting
https://android-review.googlesource.com/c/platform/external/adt-infra/+/502579/
Google is working on it to release Car emulator officially.

I could build and run Emulator in x86 version,but not with lunch car_emu_x86_64-userdebug instead aosp_x86_64 configuration.
But still need few hacks to make it up and running.

Nilesh Khairnar

unread,
Oct 4, 2018, 12:01:09 PM10/4/18
to android-porting
Hi Renjith,

I am able to build emulator for x86 version using aosp_x86_64 configuration.

>>But still need few hacks to make it up and running.
Could you please share steps for running this emulator?

Regards,
Nilesh

Bao Zhu

unread,
Dec 13, 2018, 12:29:27 PM12/13/18
to android-porting
I have built Android Automotive with Android 9.0.
And After I built it, I run emulator directly in the terminal I built the source.
And the emulator runs well for the Android Automotive.

在 2017年9月23日星期六 UTC+8上午12:17:43,Kiran Rao写道:

Manu Kemppainen

unread,
Jan 10, 2019, 12:36:18 PM1/10/19
to android-porting
Bao Zhu, can you please share the repo, build and emulator commands you were using? 
Reply all
Reply to author
Forward
0 new messages