从源代码构建Android Automotive [英] Building Android Automotive from source

查看:633
本文介绍了从源代码构建Android Automotive的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从源代码构建Android Automotive后,我该如何

After building Android Automotive from source, how do I


  1. 运行汽车模拟器?

  2. 将CarService和相关软件包安装到设备上吗?



详细信息



我正在尝试构建 Android Automotive 从来源。我可以使用以下命令成功构建它:

Details

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
$源build / envsetup.sh
$午餐car_emu_x86_64-userdebug
$ make -j8 V = 1& gt; make.log

我的问题是如何运行模拟器?谷歌搜索并浏览了一些stackoverflow帖子之后,我遇到了以下问题:

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

首先,我在命令行中设置了一个env变量(模拟器使用它来确定哪个模拟器

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

导出ANDROID_PRODUCT_OUT = / path / to / build_root

接下来,我创建了一个文件 car-emulator.sh 并将其放入其中(构建是在Ubuntu计算机上完成的)

Next, I created a file car-emulator.sh and put this in it (the build was done on an Ubuntu machine)

#!/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

我还尝试将相关的(darwin-x86_64)文件从构建计算机下载到我的Mac笔记本电脑,并尝试在那里运行。模拟器启动,但由于巨大的本机堆栈跟踪而立即崩溃。

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 with a huge native stack trace.

我的问题的下一部分是如何在设备上安装此映像?
我看到已经生成了CarService.apk。将此APK安装在设备上是否足以正常工作?还是应该将CarService和相关软件包作为需要完全刷新的系统映像的一部分?

The next part of my question is how do I install this image on a device? I see that the CarService.apk has been generated. Is it sufficient to install this APK on a device for it to work? Or should the CarService and related packages be part of a system image that needs to be flashed in its entirety?

推荐答案

我在 Android 8.1.0 分支 OPM5.171019.017 上运行它:

$ source ./build/envsetup.sh
$ lunch aosp_car_x86_64-eng
$ emulator

后跟终端上的以下输出:

Followed by the below output on the terminal:


仿真器:警告:系统分区调整大小以匹配图像文件(2562 MB> 200 MB)

emulator: WARNING: system partition size adjusted to match image file (2562 MB > 200 MB)

仿真器:警告:调整数据分区大小以匹配图像文件(550 MB> 200 MB)

emulator: WARNING: data partition size adjusted to match image file (550 MB > 200 MB)

警告:主机不支持请求的功能:CPUID.80000001H:ECX.sse4a [bit 6]

warning: host doesn't support requested feature: CPUID.80000001H:ECX.sse4a [bit 6]

警告:主机不支持请求的功能:CPUID.80000001H:ECX.sse4a [bit 6]

warning: host doesn't support requested feature: CPUID.80000001H:ECX.sse4a [bit 6]

并且android模拟器显示为b正在运行android Automotive。
如果以上解决方案在 userdebug 模式下不起作用,我建议您尝试构建工程版本。
请分享堆栈跟踪以进行进一步分析。

And the android emulator display shows up booting android automotive. I would recommend you try building the engineering version if the above solution does not work in userdebug mode. Please share the stack trace for further analysis.

关于问题的第二部分。我认为您正在将android auto与android automotive混合使用。

About the second part of your question. I think you are mixing up android auto with android automotive.

Android Auto只是一个应用程序,可以使用APK和一些小的调整来进行部署/设置,而Android Automotive是android的定制版本,专门为汽车行业设计,具有自己的一套系统应用程序。因此,不能仅通过安装APK即可将其简单地部署在设备上。

Android Auto is just an app and can be deployed/setup using an APK and some minor tweaking, while Android Automotive is a customized version of android designed specifically for the automotive industry with its own set of system applications. Therefore, it cannot be simply deployed on a device by just installing an APK.

这篇关于从源代码构建Android Automotive的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆