参考://https://source.android.com/source/downloading#installing-repo
PATH=~/bin:$PATH
chmod a+x ~/bin/repo
cd AndroidOSCode
//如果没有安装Git
sudo apt install git
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
//设置环境变量
PATH=~/bin:$PATH
//下载repo文件
chmod a+x ~/bin/repo
//源码目录
cd AndroidOSCode
//如果没有安装Git
sudo apt install git
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
//下载最新版的
repo init -u https://android.googlesource.com/platform/manifest
//下载对应版本
或repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.1_r1
//同步源码
repo sync