android 源码下载

来源:互联网 发布:java中交换两个数方法 编辑:程序博客网 时间:2024/05/29 02:52


一:获取谷歌认证;

1,登陆https://www.googlesource.com   用你的google账户登陆选择(右上角)创建new password;

2,sudo vim  ~.netrc

没有 .netrc 创建;

在刚才网站获取来的机器码下面例子是我的:

machine android.googlesource.com login xxxxxxxxxxx.qq.com password 1/qAi-e4uB8faiAvGihebrYNSQCQbLrumQYFDbepc_rXM
machine android-review.googlesource.com login xxxxxxxxxx.qq.com password 1/qAi-e4uB8faiAvGihebrYNSQCQbLrumQYFDbepc_rXM

添加到 .netrc后面

二;修改本地掩码;

sudo vim /etc/hosts

在前面添加

74.125.31.82 www.googlesource.com  74.125.31.82 android.googlesource.com  203.208.46.172 cache.pack.google.com  59.24.3.173cache.pack.google.com  


三,执行repo和获取源码

curl http://git-repo.googlecode.com/files/repo-1.13 > ~/bin/repo
chmod a+x ~/bin/repo
PATH=~/bin:$PATH
mkdir Android
cd Android
repo init -u git://codeaurora.org/platform/manifest.git
repo sync
repo init -u git://codeaurora.org/platform/manifest.git -b android-4.0.1_r1(你的版本)
repo sync(可选)


四,错误解决:

1,出现:

fatal: '../platform/abi/cpp.git' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
error: Cannot fetch platform/abi/cpp

解决:在~Android/.repo目录下的找到fetch属性
改成
fetch="git://Android.git.linaro.org/"

重新repo sync


0 0