Android4.04下载源码图解~解决公网IP不能直接访问问题
2012-05-03 00:32
573 查看
之前下的ANDROID4.0.1很顺利下来下来,有很多人问,后来才知道有很多人问关于报以下错误的
上面是链接GOOGLE源码服务器超时,也就是说不能访问到GOOGLE源码服务器,这个问题,没想到在我重新装的机子上不小心发现了,既然发现来就出来解决下吧,刚开始,一开始,我们肯定是先看官方文档,看看情况:
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
to the instructions on that page.
The second step is to force authenticated access, by using the following manifest URI:
prefix triggers mandatory authentication. You can convert an existing client to use mandatory authentication with the following command:
When downloading from behind a proxy (which is common in some corporate environments), it might be necessary to explicitly specify the proxy that is then used by repo:
More rarely, Linux clients experience connectivity issues, getting stuck in the middle of downloads (typically during "Receiving objects"). It has been reported that tweaking the settings of the TCP/IP stack and using non-parallel commands can improve the situation.
You need root access to modify the TCP setting:
以上是我在官方摘录下来的,主题是:使用认证,并且上面提到默认访问ANDROID源码是通过匿名访问的,然而为来保护过度使用服务器,且配置来每个IP地址的访问方式,在上面的英文写得很清楚,自己去看看吧,太晚来,我也不再翻译来,很简单的,那我就来几张简单的截图操作吧:
在这里需要提醒下,先要通过访问:https://android.googlesource.com/new-password来获得相关认证的用户名与密码:
点击允许,进入页面,要求你输入一个邮箱的用户名与密码,然后得出其以下页面显示:
细心点的人就会看到这么一句话:he first step is to create a password from the
password generator and to save it in
to the instructions on that page.
这是需要你去你本系统的~/下新建一个.netrc文件,默认系统下是没有的,然后把其获得的两行:
machine android.googlesource.com login git-jiangshide8.gmail.com password 1/6PLFhB-9Rbtl7-TAzm9Bzj_zKuxGNq5ALCzFfSuhHgs
machine android-review.googlesource.com login git-jiangshide8.gmail.com password 1/6PLFhB-9Rbtl7-TAzm9Bzj_zKuxGNq5ALCzFfSuhHgs
拷贝进去,然后保存,然后重新执行:
上面是链接GOOGLE源码服务器超时,也就是说不能访问到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
~/.netrcaccording
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
Troubleshooting network issues
When downloading from behind a proxy (which is common in some corporate environments), it might be necessary to explicitly specify the proxy that is then used by repo:$ export HTTP_PROXY=http://<proxy_user_id>:<proxy_password>@<proxy_server>:<proxy_port> $ export HTTPS_PROXY=http://<proxy_user_id>:<proxy_password>@<proxy_server>:<proxy_port>
More rarely, Linux clients experience connectivity issues, getting stuck in the middle of downloads (typically during "Receiving objects"). It has been reported that tweaking the settings of the TCP/IP stack and using non-parallel commands can improve the situation.
You need root access to modify the TCP setting:
$ sudo sysctl -w net.ipv4.tcp_window_scaling=0 $ repo sync -j1
以上是我在官方摘录下来的,主题是:使用认证,并且上面提到默认访问ANDROID源码是通过匿名访问的,然而为来保护过度使用服务器,且配置来每个IP地址的访问方式,在上面的英文写得很清楚,自己去看看吧,太晚来,我也不再翻译来,很简单的,那我就来几张简单的截图操作吧:
在这里需要提醒下,先要通过访问:https://android.googlesource.com/new-password来获得相关认证的用户名与密码:
点击允许,进入页面,要求你输入一个邮箱的用户名与密码,然后得出其以下页面显示:
细心点的人就会看到这么一句话:he first step is to create a password from the
password generator and to save it in
~/.netrcaccording
to the instructions on that page.
这是需要你去你本系统的~/下新建一个.netrc文件,默认系统下是没有的,然后把其获得的两行:
machine android.googlesource.com login git-jiangshide8.gmail.com password 1/6PLFhB-9Rbtl7-TAzm9Bzj_zKuxGNq5ALCzFfSuhHgs
machine android-review.googlesource.com login git-jiangshide8.gmail.com password 1/6PLFhB-9Rbtl7-TAzm9Bzj_zKuxGNq5ALCzFfSuhHgs
拷贝进去,然后保存,然后重新执行:
$ repo init -u https://android.googlesource.com/a/platform/manifest[/code]
记住与之前的多来个a路径哦,再接着,执行:sudo sysctl -w net.ipv4.tcp_window_scaling=0 $ repo sync -j1就OK了,为来让各位放心去操作,我把成功操作的图都截取下来:看看,速度还是挺快的,1016KIB/S了,OK,还没有解决其相关问题的童鞋,你还在等什么呢,试着操作一下吧,最新体验的总是有你才是.......
相关文章推荐
- Android4.04下载源码图解~解决公网IP不能直接访问问题
- Android4.04下载源码图解~解决公网IP不能直接访问问题
- Android4.04下载源码图解~解决公网IP不能直接访问问题
- 解决访问android官网和sdk不能下载问题
- 解决下载Android源码时遇到的问题
- Android - 解决国内不能从google代理服务器更新下载问题
- 解决下载下来的flexgrid.js下载下来直接使用数据不能显示的问题
- 解决springmvc不能直接访问 jsp的问题
- 不能下载Android源码的解决方法
- Android 访问Webservice接口,参数对象不能串行化问题解决(java.lang.RuntimeException: Cannot serialize)
- Android --- windows下搭建Linux环境下载编译Android源代码--解决下载android系统源码错误问题
- 解决下载Android源码时遇到的问题
- Android源码编译之后G-Sensor不能使用问题的解决
- 解决下载Android源码时遇到的问题
- 解决谷歌为Android系统提供的支持库android-support-v4。jar不能绑定查看源码的问题
- C#技巧【调用线程无法访问此对象,因为另一个线程拥有该对象的问题的解决办法】【C#读写EXCEL源码提示“office检测到此文件存在一个问题。为帮助保护您的计算机,不能打开此文件”的解决】
- AJAX tab显示不全及Android ADT不能下载的问题(已解决)
- 解决下载Android源码时遇到的问题
- 解决Android SDK Manager不能下载更新SDK的问题
- 解决下载Android源码时遇到的问题