今天正准备编译Android源码,根据官网的指示,首先应该执行
curl https://android.git.kernel.org/repo > ~/bin/repo
来下载repo文件,但报出如下错误:
curl: (6) Couldn't resolve host 'android.git.kernel.org'
通过浏览器访问http://android.git.kernel.org/时也被报告无法找到服务器。我就是在家里用普通的宽带上网,没有像在公司里面那样有处于防火墙之后的可能。心里面正在暗骂方某人的时候,转念一想,政府应该不会无聊到这个地步,连这个都墙。继续调查之后,发现9月分以来国外也有人遇到同样的问题。加之8月底kernel.org被黑,也可能导致android.git.kernel.org无法访问。姑且先相信是Android的服务器自己爆掉了,按如下方法,下载到源代码(来源):
- 1.?curl?"http://php.webtutor.pl/en/wp-content/uploads/2011/09/repo"?>~/bin/repo??
- 2.?chmod?a+x?~/bin/repo??
- 3.?PATH=~/bin:$PATH??
- 4.?cd?your_download_folder??
- 5.?repo??init??-u??git://codeaurora.org/platform/manifest.git?-b?gingerbread??
- 6.?repo?sync ?
另外,据称Android源代码在github也有保存,具体怎么弄下来不知到。如果哪天上面的方法也无效了话,可以研究一下。
转载:http://blog.csdn.net/crazysjf/article/details/6840671
1 楼 choclover 2011-11-01
How to get android source code from github mirror
Get android source code using repo
Since the android.git.kernel.org is down now, so we can't get android source
code from there now. But AOSP has a mirror on github, so we can try to get
android source code there.
Get repo
#cd ~/your_android_dir
#curl https://github.com/android/tools_repo/blob/master/repo > ~/bin/repo
#chmod a+x ~/bin/repo
Init repo
#repo init --repo-url=git://github.com/android/tools_repo.git -u \
git://github.com/android/platform_manifest.git
NOTE:repo-url refers to repo tool url, and -u specifies android manifests
Sync repo
#repo sync -j16
Congratulations
Now you can work with AOSP
Get android source code using repo
Since the android.git.kernel.org is down now, so we can't get android source
code from there now. But AOSP has a mirror on github, so we can try to get
android source code there.
Get repo
#cd ~/your_android_dir
#curl https://github.com/android/tools_repo/blob/master/repo > ~/bin/repo
#chmod a+x ~/bin/repo
Init repo
#repo init --repo-url=git://github.com/android/tools_repo.git -u \
git://github.com/android/platform_manifest.git
NOTE:repo-url refers to repo tool url, and -u specifies android manifests
Sync repo
#repo sync -j16
Congratulations
Now you can work with AOSP