Cygwin Android源代码下载

来源:互联网 发布:数据透视表怎么做差异 编辑:程序博客网 时间:2024/06/05 00:48
1、安装cygwin
安装cygwin时记得安装上,curl, git, busybox, python等库文件。cygwin的库文件可以在安装引导文件补充添加。
网上推荐的安装文件如下:
Net -> curl
Devel -> git* (git, git-completion, git-gui, gitk)
Libs -> libreadline6, libiconv2
Editors -> vim
Python -> python
2、安装 Repo
Repo 是一款python脚本,可让您在 Android 环境中更轻松地使用 Git。
(1)确保主目录下有一个 bin/ 目录,并且该目录包含在路径中:
$ mkdir ~/bin$ PATH=~/bin:$PATH
(2)下载 Repo 工具,并确保它可执行:
$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo$ chmod a+x ~/bin/repo

3、创建一个空目录。
$ mkdir **$ cd **
4、姓名和电子邮件地址配置 Git。
$ git config --global user.name "Your Name"$ git config --global user.email "you@example.com"
5、下载
(1)运行 repo init 以获取最新版本的 Repo 。
$ repo init -u https://android.googlesource.com/platform/manifest
要对“master”以外的分支进行校验,请使用 -b 来指定相应分支。要查看分支列表,请参阅源代码标记和版本。
$ repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.1_r1
初始化成功后,系统将显示一条消息,告诉您 Repo 已在工作目录中完成初始化。客户端目录中现在应包含一个 .repo 目录,清单等文件将保存在该目录下。

(2)下载 Android 源代码树,要将 Android 源代码树从默认清单中指定的代码库下载到工作目录,请运行以下命令。
$ repo sync

后记:
首页要保证本机可以访问google;
另外自己在参照很多csdn博客时,参照他们的方法遇到90814等端口无法访问,导致无法repo sync问题,折腾一堆如何使用代理访问。其实,是rpeo init的目标网址不对,找到正确的Google官方指导后,一切很顺利完成。

原创粉丝点击