您的位置:首页 > 移动开发 > Android开发

android 源码下载

2014-02-25 19:53 323 查看
一:获取谷歌认证;

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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  android 源码 下载