android源码下载, 看了几篇博客,综合下成功了。
没有板子就学android系统源码,于是乎首先需要从google的服务器上下载android系统源码。在网上找些博客跟着做,但是并没有照着一篇做就成功了。所以借前辈们的检验做个小总结,也许我这里可以别人用或许又有新的问题。
参考:1. http://blog.csdn.net/zeroboundary/article/details/17555183
2. http://blog.csdn.net/lengxibo/article/details/8299888
3. http://yukun.elastos.org/2013/06/22/%E8%A7%A3%E5%86%B3%E4%B8%8B%E8%BD%BDandroid%E4%BB%A3%E7%A0%81%E6%97%B6failed-connect-to-android-googlesource-com443%E5%8A%9E%E6%B3%95/
我的环境为ubuntu10.04, 64bit
1. 安装curl工具
$ sudo apt-get install curl
2. git工具的安装(按照如下方式安装最新版)
$ sudo apt-add-repository ppa:git-core/ppa
$ sudo apt-get update
$ sudo apt-get install git
3. repo工具的下载
google是这样告诉我们的:
$ curl http://git-repo.googlecode.com/files/repo-1.12 > ~/bin/repo
$ chmod a+x ~/bin/repo
4. repo init创建仓库
$ ./repo init -u https://android.googlesource.com/platform/manifest -b android-4.4.2_r1
5. 执行repo sync 进行同步
$ ./repo sync
问题1:“A new repo command ( 1.18) is available.”
其实这个问题就是说你本地的repo版本不是1.18,比这个旧,在出现这个的时候,下面会有一个提示你怎么操作的,如:
... A new repo command ( 1.18) is available.
... You should upgrade soon:
cp /home/pn/android/.repo/repo/repo/home/pn/bin/repo
问题2:下载android代码时错误提示:error: Failed connect to android.googlesource.com:443
解决方法:编辑/etc/hosts文件
$ sudo vim /etc/hosts
在网上找到两种内容
a. 增加下面内容,保存
173.194.72.82 http://www.googlesource.com
173.194.72.82 android.googlesource.com
37.61.54.158 cache.pack.google.com
173.194.74.82 gerrit.googlesource.com
b. 增加如下内容,保存
74.125.71.82 www.googlesource.com
74.125.71.82 android.googlesource.com
203.208.46.172 cache.pack.google.com
59.24.3.173cache.pack.google.com
两个都可以试一下。
问题三:下载中出现此现象fatal: unable to access 'https://android.googlesource.com/platform/manifest-b/': Failed connect to android.googlesource.com:443; Operation now in progress
fatal: unable to access 'https://android.googlesource.com/platform/manifest-b/': Failed connect to android.googlesource.com:443; Operation now in progress
fatal: unable to access 'https://android.googlesource.com/platform/abi/cpp/': Failed connect to android.googlesource.com:443; Operation now in progress
fatal: unable to access 'https://android.googlesource.com/platform/art/': Failed connect to android.googlesource.com:443; Operation now in progress
fatal: unable to access 'https://android.googlesource.com/platform/bionic/': Failed connect to android.googlesource.com:443; Operation now in progress
fatal: unable to access 'https://android.googlesource.com/platform/bootable/bootloader/legacy/': Failed connect to android.googlesource.com:443; Operation now in progress
如解决最好,但是我一直等待,跳过这些可以执行,也许有人是不可以的。上面那种可以试试是否可以解决。
更多相关文章
- android 蓝牙、低功耗BLE开发问题总结
- android 视频下载
- android 之 DownloadManager
- Android(安卓)View框架总结(一)
- 如何设置Android的AVD模拟器可以输入中文
- [原] Android中Scroller类的分析
- Android(安卓)AndroidMainifest.xml 中 Android:sharedUserId
- Android(安卓)Secret Code
- Android(安卓)获取进程名称(可以区分内部进程)