今天下载Android源码遇到了一点小问题,后来在一个哥们的博客上找到了答案,分享给大家
repo:
http://code.google.com/p/git-repo/
之前的
curl -v https://android.git.kernel.org/repo > ~/bin/repo
已经不能用了,网址解析不到...
android.git.kernel.org现在被黑了,所以调整源码地址为:
codeaurora.org
curl http://git-repo.googlecode.com/files/repo-1.13 > ~/bin/repo
chmod a+x ~/bin/repo
PATH=~/bin:$PATH
mkdir WORKING_DIRECTORY
cd WORKING_DIRECTORY
repo init -u
git://codeaurora.org/platform/manifest.git
repo sync
repo init -u git://codeaurora.org/platform/manifest.git -b gingerbread (可选)
repo sync(可选)
上述方法下载的源码最新的应该是4.1.2,经过本人多次尝试,可使用以下方法:
下载之前应该先进入https://android.googlesource.com/new-password ,登陆google账户,得到一个这种格式的数据
machine android.googlesource.com login git-.gmail.com password
machine android-review.googlesource.com login git-.gmail.com password
新建一个.netrc文件,复制以上内容到该文件中
android源码git分支查看进https://android.googlesource.com/platform/manifest
经过多次试验curl https://android.googlesource.com/a/platform/manifest > ~/bin/repo可以正常使用
但是此时repo init -u https://android.googlesource.com/a/platform/manifest -b android-4.3_r2.1 出现以下错误提示:
../bin/repo: 行 1: 未预期的符号 newline' 附近有语法错误../bin/repo: 行 1:
quot;-//IETF//DTD HTML 2.0//EN">'
改用curl "http://php.webtutor.pl/en/wp-content/uploads/2011/09/repo" > ~/bin/repo
然后repo init -u https://android.googlesource.com/a/platform/manifest -b android-4.3_r2.1
此时如果还有问题将https改为http或者在.repo目录下的manifest.xml里找到fetch属性
改成
fetch="git://Android.git.linaro.org/"
最后repo sync ,OK,搞定!