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

android源码下载方式

2011-09-04 11:10 369 查看
android源码下载方式:

方式一:

repo init -u git://android.git.kernel.org/platform/manifest.git

repo sync

这是官方提供的下载方式,但最近使用这种方式出现网络连接超时,据说是被hack掉了

同时,注意到kernel源码网站却依然能够访问:http://android.git.kernel.org/kernel/

于是,使用git方式下载: git clone http://android.git.kernel.org/kernel/common.git
最后,成功了

详见博客:android.git.kernel.org[0:199.6.1.173]: errno=Connection refused

方式二:

把方式一的下载命令中的git修改为http(配置文件需一并修改),则可以顺利下载源码

具体修改步骤如下:

1. 编辑/home/username/bin/repo文件

修改:REPO_URL='git://android.git.kernel.org/tools/repo.git'

改为:REPO_URL='http://android.git.kernel.org/tools/repo.git'

2. 运行新的命令

repo init -u http://android.git.kernel.org/platform/manifest.git
3. 修改文件.repo/manifests/default.xml

修改:fetch="git://android.git.kernel.org/"

改为:fetch="http://android.git.kernel.org/"

4. 运行同步命令,下载源码到本地

repo sync

成功!!!



git使用推荐:

linux git命令参数及用法详解--版本控制工具

VersionControl with Repo and Git

Git 常用命令
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: