镜像同步Android源代码

来源:互联网 发布:淘宝店掌柜名怎么修改 编辑:程序博客网 时间:2024/06/05 10:08

对于没有翻墙的用户,可以使用清华大学的镜像。

  • https://mirrors.tuna.tsinghua.edu.cn/help/AOSP/
    3.1.1 同上述步骤,新建一个用于存放下载脚本文件的目录
mkdir ~/binPATH=~/bin:$PATH

3.1.2 下载Repo

git clone https://aosp.tuna.tsinghua.edu.cn/android/git-repo.git/cp git-repo/repo ~/bin/

3.1.3 修改Repo文件
~/bin/repo

REPO_URL = 'https://gerrit.googlesource.com/git-repo'改为REPO_URL = 'https://gerrit-google.tuna.tsinghua.edu.cn/git-repo'

3.1.4 创建用于存放Android源代码的目录

mkdir android_sourcecd android_source

3.1.5 同步源代码

repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest -b android-4.0.1_r1repo sync -j4由于首次同步需要下载 24GB 数据,过程中任何网络故障都可能造成同步失败,建议直接使用初始化包进行初始化。 3.2.1下载初始包
#下载重试不限次数,防止网络异常中断wget -c -t 0 https://mirrors.tuna.tsinghua.edu.cn/aosp-monthly/aosp-latest.tar tar -vxzf aosp-latest.tarcd aosp #这时ls的话什么也看不到,因为只有一个隐藏的.repo目录repo sync