#1. 安装Git
# ubuntu系统直接使用sudo apt-get install git-core就能完成安装。
# 安装完成之后可以顺便配置一下个人信息:
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
#2. 设置环境变量和repo安装目录
# 将下载repo的路径加入环境变量
mkdir ~/bin
vim ~/.bashrc
+export PATH=~/bin:$PATH
source ~/.bashrc
#3. repo工具的安装
###网上已知可以下载repo的网址
#1. curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
#2. 可以从清华aosp镜像网站git clone下一个整个仓库。然后把仓库里面的repo文件复制到 ~/bin目录下面。
git clone https://aosp.tuna.tsinghua.edu.cn/tools/repo
#4. 建立工作目录 && 初始化仓库
建立工作目录:
mkdir sourcecode && cd sourcecode
初始化仓库:
repo init -u https://source.codeaurora.org/quic/la/platform/manifest.git \
-b release -m LA.UM.6.6.r1-02700-89xx.0.xml \
--repo-url=https://aosp.tuna.tsinghua.edu.cn/tools/repo
#5. repo sync同步下载
repo sync -cdj 4 --no-tags #一般是这样用的。
#6. 加快repo下载速度 - 建立本地mirror
### 初始化本地mirror
mkdir /home/mirror && cd /home/mirror //注意首次初始化mirror需在一个空目录下
repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest \
-b android-4.0.1_r1 \
--repo-url=https://aosp.tuna.tsinghua.edu.cn/tools/repo \
--mirror
这样就初始化好本地镜像了。然后执行repo sync命令。网络不好的情况请多执行 repo sync 几次。
repo sync -cdj 4 --no-tags
### 下载sourcecode时使用本地mirror
cd {DIR}/sourcecode
repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest \
-b android-4.0.1_r1 \
--repo-url=https://aosp.tuna.tsinghua.edu.cn/tools/repo \
--reference /home/mirror
repo sync -cdj 4 --no-tags
#7. 总结
初次使用repo下载sdk,各种注意点尚未完善,以待日后补全。
#8. 参考博客
感谢: \ (≥▽≤) /
[1] Android下的配置管理之道之repo的使用 - 马哥私房菜