参考文献:Android内核开发:理解和掌握repo工具
1.repo 安装
官方:
curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ./repo(速度太慢)
gitclonegit://git.omapzoom.org/git−repo.git(可用)
git clone git://aosp.tuna.tsinghua.edu.cn/android/git-repo.git/
2.环境变量配置
我的repo脚本放在/Users/seedinwind/Documents/study/tools/repo/git-repo
export REPO=/Users/seedinwind/Documents/study/tools/repo/git-repo
export PATH=$PATH:${REPO}
3.下载源码
官方:
$ mkdir studio-master-dev
$ cd studio-master-dev
$ repo init -u https://android.googlesource.com/platform/manifest -b studio-master-dev
$ repo sync
镜像:
$ repo init -u git://git.omapzoom.org/platform/manifest.git
$ repo init -u git://aosp.tuna.tsinghua.edu.cn/android/platform/manifest
使用-b 选择版本
$ repo init -u git://git.omapzoom.org/platform/manifest.git -b studio-2.2
完整命令
$ mkdir studio-master-dev
$ cd studio-master-dev
$ repo init -u git://git.omapzoom.org/platform/manifest.git -b studio-2.2
$ repo sync
“`