今天下載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,搞定!