android源码下载方式:

方式一:

1) 创建~/bin

$ mkdir ~/bin $ PATH=~/bin:$PATH
2) 下载repo

$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo $ chmod a+x ~/bin/repo
3) 创建保存Android源码文件

$ mkdir WORKING_DIRECTORY $ cd WORKING_DIRECTORY
4) 下载Android源码(master主干)

$ repo init -u https://android.googlesource.com/platform/manifest
下载Android源码(branch分支)

$ repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.1_r1
更多分支目录: https://android.googlesource.com/platform/manifest


5) 启动同步下载

$ repo sync

上面是官方提供的下载方式


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

使用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.编辑~/bin/repo文件: vi ~/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 -uhttp://android.git.kernel.org/platform/manifest.git


3.修改文件~/WORKING_DIRECTORY/.repo/manifests/default.xml: vi ~/WORKING_DIRECTORY/.repo/manifests/default.xml

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

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


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

repo sync

成功!!!


android源码下载方式_第1张图片



git使用推荐:

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

VersionControl with Repo and Git

Git常用命令

原文地址:http://blog.csdn.net/sunboy_2050/article/details/6746810

更多相关文章

  1. 创建android逐帧动画的两种方式
  2. 【安卓笔记】android客户端与服务端交互的三种方式
  3. [android源码下载索引贴】微信+二维码那都不是事......
  4. Android 4.0.1 源码下载,编译和运行
  5. Android执行shell命令
  6. android触摸实现物体运动方式
  7. TabHost两种实现方式
  8. 【【【常用的ubuntu第三方工具及android命令(自存档)】】】二

随机推荐

  1. Android(安卓)拍照并对照片进行裁剪和压
  2. Android集成支付宝移动支付功能
  3. 简单的android ios抓包技巧
  4. PreferenceActivity用法简介
  5. Android(安卓)ListView下拉/上拉刷新:设计
  6. Android必知必会-自定义Scrollbar样式
  7. Android学习【0】安装android studio报错
  8. android耗时任务_IntentService
  9. android 与服务器用 http Post方法通迅
  10. Android中的Bundle的具体使用