//创建一个空的文件夹,用于下载
mkdir android-8.0.0_r17
cd android-8.0.0_r17
//为git配置全局姓名和邮箱
git config --global user.name <Your name>
git config --global user.email <Your email>
//运行repo init以获取最新版本的Repo及最近的所有错误更正内容。
//指定一个网址,该网址用于指定Android源代码中包含的各个代码库将位于工作目录中的什么位置。
//要对“master”意外的分支进行检验,要使用-b来指定分支。
repo init -u https://android.googlesource.com/platform/manifest -b android-8.0.0_r17
//-c的含义是只fetch当前分支(fetch only current branch from server),需要翻墙和等待
repo sync -c
//本地构建编译环境
source build/envsetup.sh
//选择对应的机型
lunch
//使用8个线程进行全编译,输出目录为out/target/product/<lunch选择的机型>/
make -j8
//编译单独模块,如Settings应用,输出目录为out/target/product/<lunch选择的机型>/system/priv-app/Settings/
mmm packages/apps/Settings -j8
源代码标记和版本:https://source.android.com/source/build-numbers.html#source-code-tags-and-builds
各版本源代码查看:http://androidxref.com/