windows下使用repo下载安卓源码

网上找了一些方法 都是比较早期的 过时的方法。
后来总结一下 结合官网linux下的方法 成功在windows下下载了安卓4.2.2
http://source.android.com/source/downloading.html#initializing-a-repo-client
现在总结如下:

1.安装Cygwin
下载 Cygwin ,然后就是一路的下一步(注意:如果第一次安装,你需要选install from internet
然后就是选安装位置,还有临时文件的位置和连接网络的设置,这些都默认就可以.关键的一步是选择要安装的库和程序,以下这几个是要安装的:

Net -> curl
Devel -> git,git-completion,git-gui,gitk
Libs -> libreadline6,libiconv2
Editors -> vim
Python -> python

如果不好找,你可以在上面的Search上搜索.
感谢witxjp   https://android.googlesource.com/tools/repo

2.安装 Repo
打开cygwin,两句命令搞定repo工具(https不行的话 换http)
$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > /bin/repo
$ chmod a+x /bin/repo

3.初始化 Repo client
我的是在D盘建立一个文件夹AndroidSource
$ cd d:/AndroidSource
$ repo init -u https://android.googlesource.com/platform/manifest
同样https不行的话 换成http
然后提示需要输入gmail姓名和账号
Your Name
Your Email
输入后按y确认
最后确认在账号中颜色的显示
  black    red      green    yellow   blue     magenta   cyan     white
  bold   
任选一个 确定,搞定。

4.确定下载安卓源码的分支 版本
$ repo init -u https://android.googlesource.com/platform/manifest -b android-4.2.2_r1.2
同样有一个颜色提醒
$ Enable color display in this user account (y/N)? y
就会提示完成了initialize
$ repo has been initialized in /cygdrive/d/neon/AndroidSource

5.同步源码
$ repo sync
以下就看网速啦

原文地址:https://www.cnblogs.com/zzugyl/p/3110145.html