Skip to content

1.2 Preparing your system to build

easternday edited this page Jan 26, 2022 · 1 revision

综述(Abstract)

AOSP 源码官方要求是 Linux ,不支持 MacOSWindows 。同时也不再支持 Python2 ,建议使用 Python3

It is officially recommended that AOSP compile with Linux and do not support MacOS and windows. Python 2 is no longer supported. Python3 is recommended.

自己构建编译环境(Prepare by yourself)

根据Google官方给出的编译环境,建议使用 Ubuntu ,同时 JDK 是我们所必需的,其次需要一些其他依赖,请参考官方的搭建构建环境

According to the official compilation environment given by Google, it is recommended to use Ubuntu. At the same time, JDK is necessary for us. Secondly, we need some other dependencies. Please refer to the official build environment

一些方便的脚本(Convenient scripts)

Ubuntu

安装 git 之后运行如下脚本将自动配置构建环境:

Install git and then run the bash as follow:

cd ~/
git clone https://github.com/akhilnarang/scripts
cd scripts
./setup/android_build_env.sh

Arch/Manjaro

aosp-develAUR 综合包提供了他们全部简易安装。

如果你需要编译 LineageOS ,它们可以与 lineageos-develAUR 元软件包一起安装。

The aosp-develAUR comprehensive package provides all their easy installation. If you need to compile LineageOS, they can be installed with the lineageos-develAUR metapackage.

# compile aosp
yay -S aosp-devel
# or compile lineageos
yay -S lineageos-devel

参考(Reference)

[1] Google-搭建构建环境

[2] akhilnarang/scripts

[3] Android(简体中文)#构建_Android - ArchWiki

Clone this wiki locally