1. 下载repo
mkdir ~/bin
PATH=~/bin:$PATH
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
2. 下载源码:
##指定 repo 仓库服务器
export REPO_URL='https://mirrors.ustc.edu.cn/aosp/git-repo.git/'
##下载 repo 仓库,并指定 android 版本 //中科大 AOSP 镜像网站下载
repo init -u git://mirrors.ustc.edu.cn/aosp/platform/manifest -b android-10.0.0_r45
##下载 android 源码, 建议用低于 4 个线程下载
repo sync -j4
3. 编译源码: