一、前言
- 因工作需要,需要编译 Android Q 源码并且部署到开发机中,所以查找了相关资料特此记录。
- 参考资料: AOSP 镜像使用帮助
二、Android Q 的源码编译
2.1 编译环境
- ubuntukylin20.04 LTS ,内存16GB(亲测至少需要10GB,不然影响编译,并且会报"killed"相关错误),硬盘200GB
- OpenJDK 8
需要的硬盘空间特别大,不影响虚拟机原始空间的情况下,建议外挂一块200GB的硬盘
2.2 源码下载
2.2.1 repo 的安装
mkdir ~/bin
PATH=~/bin:$PATH
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
## 如果上述 URL 不可访问,可以用下面的:
## curl -sSL 'https://gerrit-googlesource.proxy.ustclug.org/git-repo/+/master/repo?format=TEXT' |base64 -d > ~/bin/repo
chmod a+x ~/bin/repo