windows xp 中cygwin 下载android源码

  1. 安装Cygwin。因为repo脚本的运行必须在linux下,因此我们要安装Cygwin。Cygwin是一个在Windows平台下运行的Unix模拟环境,点击这里下载
  2. 安装Cygwin的过程中可以选择要安装的包,以下是我们要安装的包:
    1、Net -> curl;
    2、Devel -> git* (git, git-completion, git-gui, gitk);
    3、Libs -> libreadline6, libiconv2;
    4、Editors -> vim
    5、Python -> python。
  3. $ mkdir ~/bin
    $ PATH=~/bin:$PATH
    
  4. $ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
    $ chmod a+x ~/bin/repo
    
    4
  5. $ mkdir WORKING_DIRECTORY
    $ cd WORKING_DIRECTORY
    
    $ repo init -u https://android.googlesource.com/platform/manifest
    

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

    $ repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.1_r1
    
  6. Getting the files

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

  7.  

    $ repo sync
    

 

 

 

按照上面的方法,下载时,可能报连接超时,这是因为,android源码,默认下载是用匿名方式的,google为了某种性能和管理目的,做了限制,像一 般的,动态公网IP就 可能下载不了。为此,google提供了认证方式下载。

 

 

Using authentication

By default, access to the Android source code is anonymous. To protect the servers against excessive usage, each IP address is associated with a quota.

When sharing an IP address with other users (e.g. when accessing the source repositories from beyond a NAT firewall), the quotas can trigger even for regular usage patterns (e.g. if many users sync new clients from the same IP address within a short period).

In that case, it is possible to use authenticated access, which then uses a separate quota for each user, regardless of the IP address.

The first step is to create a password from the password generator and to save it in ~/.netrc according to the instructions on that page.

The second step is to force authenticated access, by using the following manifest URI: https://android.googlesource.com/a/platform/manifest. Notice how the /a/ directory prefix triggers mandatory authentication. You can convert an existing client to use mandatory authentication with the following command:

$ repo init -u https://android.googlesource.com/a/platform/manifest
也就是,
第一步,去google上产生认证信息,点击上面的"the password generator"
第二步:在cygwin当天用户目录下,新.netrc文件,并把产生的认证信息,填入。
第三步 :使用此方式,初始化repo:
   repo sync
最终挂机6个多小时,下载完成,给个图片让学友们看看
 
  1. 参考来源:
  2. http://source.android.com/source/downloading.html
  3.  http://www.2eggs.org/?p=97
  4. http://www.cnblogs.com/mandroid/archive/2011/06/06/2073473.html
  5. http://blog.rexzhao.com/2011/11/29/Google-Code-set-netrc.html

http://my.oschina.net/armsky/blog/55644?p=1#rpl_267635548

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值