windows xp 中cygwin 下载android源码
- 安装Cygwin。因为repo脚本的运行必须在linux下,因此我们要安装Cygwin。Cygwin是一个在Windows平台下运行的Unix模拟环境,点击这里下载。
- 安装Cygwin的过程中可以选择要安装的包,以下是我们要安装的包:
1、Net -> curl;
2、Devel -> git* (git, git-completion, git-gui, gitk);
3、Libs -> libreadline6, libiconv2;
4、Editors -> vim
5、Python -> python。 -
$ mkdir ~/bin $ PATH=~/bin:$PATH
-
4$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo $ chmod a+x ~/bin/repo
-
$ 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
-
Getting the files
To pull down files to your working directory from the repositories as specified in the default manifest, run
-
$ 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
第四步: