android源码编译——从此走上Liunx的不归路(三)

下载android源码:

1.安装git和curl:

sudo apt-get install git-core

sudo apt-get install git-core curl

2.下载repo

mkdir ~/bin
PATH=~/bin:$PATH
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
// 如果上述 URL 不可访问,可以用下面的:
//curl https://storage-googleapis.lug.ustc.edu.cn/git
//-repo-downloads/repo > ~/bin/repo

3.创建工作目录

mkdir workspace
cd workspace

4.初始化仓库

repo init -u git://mirrors.ustc.edu.cn/aosp/platform/manifest

// 清华提供的镜像源
// repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest

// 中国科技技术大学的镜像源
// repo init -u git://mirrors.ustc.edu.cn/aosp/platform/manifest

// 如果提示无法连接到 gerrit.googlesource.com
// 编辑~/bin/repo文件,把REPO_URL一行替换成:REPO_URL='https://gerrit-googlesource.lug.ustc.edu.cn/git-repo'

5.下载android版本源码

repo init -u git://mirrors.ustc.edu.cn/aosp/platform/manifest -b android-4.0.4_r2.1

6.同步源码树

repo sync

 

原文摘自repo下载国内链接android源码

但行好事,莫问前程;你若盛开,蝴蝶自来;你若坚强,命运自会给你打赏。
原文地址:https://www.cnblogs.com/songjie-xuan/p/7280688.html