灯火互联
管理员
管理员
  • 注册日期2011-07-27
  • 发帖数41778
  • QQ
  • 火币41290枚
  • 粉丝1086
  • 关注100
  • 终身成就奖
  • 最爱沙发
  • 忠实会员
  • 灌水天才奖
  • 贴图大师奖
  • 原创先锋奖
  • 特殊贡献奖
  • 宣传大使奖
  • 优秀斑竹奖
  • 社区明星
阅读:1962回复:0

android4.0下载问题

楼主#
更多 发布于:2012-09-06 14:00

最近在下载Android4.0的代码,下列操作
下载Repo
$ mkdir ~/bin
$ PATH=~/bin:$PATH
$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
创建源码目录:


$ mkdir Android_SOURCE
$ cd Android_SOURCE
获取git上的Android源码版本
$ repo init -u https://android.googlesource.com/platform/manifest
我们下载最新版
$ repo init -u https://android.googlesource.com/platform/manifest -b Android-4.0.3_r1
$ repo sync
可加参数: -jx x代表开启多少个线程来下载源码


按照 google 的官网设置会出现在下载的时候产生错误 从而不能下载,之前Android的代码是在Linux kernel(Android.git.kernel.org)管理,被Kernel踢出来之后,Android源码现在直接由Google(Android.googlesource.com)管理。
用repo/git下载源码时


发现有错误:
DownloadError: Android.googlesource.com: <urlopen error [Errno 110] Connection timed out>




在源码网站 http://source.android.com/source/downloading.html可以了解信息:


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


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


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


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


The second step is to force authenticated access, by using the followingmanifest URI:https://android.googlesource.com/a/platform/manifest. Noticehow the/a/ directory prefix triggers mandatory authentication. You canconvert an existing client to use mandatory authentication with the followingcommand:


$ repo init -u https://android.googlesource.com/a/platform/manifest

登录https://android.googlesource.com/new-password 用自己注册邮箱登录,点击网页上的“允许访问”,得到类似
machine Android.googlesource.com login git-<userName>.gmail.com password <password>
machine Android-review.googlesource.com login git-<userName>.gmail.com password <password>
把上面那段信息追加到~/.netrc文件结尾(请检查当前用户的权限, 如果不存在此文件则自己新建一个)
下载地址的URI更改为https://android.googlesource.com/a/platform/manifest(中间加上了“/a”)。
repo init -u https://android.googlesource.com/a/platform/manifest -b Android-4.0.3_r1
repo sync -j10











喜欢0 评分0
游客

返回顶部