Chinaunix首页 | 论坛 | 博客
  • 博客访问: 9145957
  • 博文数量: 1725
  • 博客积分: 12961
  • 博客等级: 上将
  • 技术积分: 19840
  • 用 户 组: 普通用户
  • 注册时间: 2009-01-09 11:25
个人简介

偷得浮生半桶水(半日闲), 好记性不如抄下来(烂笔头). 信息爆炸的时代, 学习是一项持续的工作.

文章分类

全部博文(1725)

文章存档

2024年(1)

2023年(26)

2022年(112)

2021年(217)

2020年(157)

2019年(192)

2018年(81)

2017年(78)

2016年(70)

2015年(52)

2014年(40)

2013年(51)

2012年(85)

2011年(45)

2010年(231)

2009年(287)

分类: Android平台

2013-09-17 09:33:09

1.1、安装cygiwn.
首先需要安装Cygwin,关于此的详细内容请参考cygwin安装详解》。
注意在安装Cygwin时,我们除了安装默认的组件,我们还需要安装bash, curl, git and python
1.2、添加path路径
编辑.bash_profile添加path路径。.bash_profile文件位于“%cygwin安装目录%\home\%用户%”这个目录。比如我的就是“D:\tools\cygwin\home\rohu
.bash_profile文件中追加一行
export PATH=~/bin:$PATH
1.3、安装repo
通过Cygwin菜单Cygwin Terminal进入shell命令行。
输入以下命令:
mkdir ~/bin
curl --insecure  > ~/bin/repo
chmod a+x ~/bin/repo
如果在国内,需要代理才能出去。我在假设代理服务器为“127.0.0.2::8080
如果用代理的话,上面的命令就应该变为:
mkdir ~/bin
curl --insecure --proxy 127.0.0.2:8080  > ~/bin/repo
chmod a+x ~/bin/repo
到此repo脚本文件就安装好了。
1.4、配置git
shell命令行,输入以下命令:
git config --global http.sslverify "false"
如果在国内,需要代理才能出去。如果用代理的话,还需要加上一个句命令。
假设代理服务器为“127.0.0.2::8080”,则命令为:
git config --global http.proxy "127.0.0.2:8080"
到此git就配置好了。
1.5、安装repo客服端
1.5.1、新建一个工作目录WORKING_DIRECTORY,切换到该目录,以便存放Android源码:
在shell命令行,输入以下命令:
$ mkdir WORKING_DIRECTORY $ cd WORKING_DIRECTORY
15.2、Run repo init to bring down the latest version of Repo with all its most recent bug fixes. You must specify a URL for the manifest, which specifies where the various repositories included in the Android source will be placed within your working directory.
$ repo init -u 

To check out a branch other than "master", specify it with -b:

$ repo init -u  -b android-4.0.1_r1
1.5.3、When prompted, please configure Repo with your real name and email address. To use the Gerrit code-review tool, you will need an email address that is connected with a . Make sure this is a live address at which you can receive messages. The name that you provide here will show up in attributions for your code submissions.在运行1.5.2的命令时,会弹出一个要求输入你的gmail邮箱的提示。最好输入有效的邮箱地址。
A successful initialization will end with a message stating that Repo is initialized in your working directory. Your client directory should now contain a .repo directory where files such as the manifest will be kept.
在repo完成初始化后,你再当前目录下,应该能看到一个".repo"目录,manifest等就在该目录下。
1.6、取得源码

To pull down files to your working directory from the repositories as specified in the default manifest, run

$ repo sync

The Android source files will be located in your working directory under their project names. The initial sync operation will take an hour or more to complete. For more about repo sync and other Repo commands, see .

执行上面的命令,Android的源码就开始下载了,它将被下载到".repo"目录的"projects"目录下。
阅读(3144) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~