选择下载Android源代码AOSP分支,推荐使用清华镜像:https://mirrors.tuna.tsinghua.edu.cn/help/AOSP/ 使用教程清华源已经详细给出,我这里选择的android-10.0.0_r40
使用repo工具
curl https://mirrors.tuna.tsinghua.edu.cn/git/git-repo -o repo
chmod +x repo
export REPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo'
repo init -u https://mirrors.tuna.tsinghua.edu.cn/git/AOSP/platform/manifest -b android-10.0.0_r40
repo sync
下载对应驱动
https://developers.google.com/android/drivers#taimenqp1a.190711.019
将驱动解压到源码根目录下
./extract-google_devices-blueline.sh
./extract-qcom-blueline.sh
以按ctrl+c进行中断,在此会提示需要输入I ACCEPT
编译Android源码
source build/envsetup.sh
lunch
make -j12