下载Android 源码
来源:互联网 发布:linux tar解压zip 编辑:程序博客网 时间:2024/06/07 06:49
国内被墙后如何获取android源代码
按照http://source.android.com上的步骤并不能获取android源代码,估计又是被墙了。不过经过研究发现可以从一些镜像站点上获取android源代码
下载代码出错
- error: Failed to connect to 2404:6800:4005:c00::52: Network is unreachable while accessing https://android.googlesource.com/mirror/manifest/info/refs
- fatal: HTTP request failed
解决方法
1. 浏览器登录https://android.googlesource.com/new-password,并用gmail帐号登录;
2. 点击网页上的“允许访问”,得到类似
- machine android.googlesource.com login git-jacky.rg4.net password 1/dkRiGEvvC8o8Pgg-GsM2AbMNS_32-U0Pf0_VWkYogIA
- machine android-review.googlesource.com login git-jacky.rg4.net password 1/dkRiGEvvC8o8Pgg-GsM2AbMNS_32-U0Pf0_VWkYogIA
3. 把上面那段信息追加到~/.netrc文件结尾(请检查当前用户的权限, 如果不存在此文件则自己新建一个);
4. 下载地址的URI更改为https://android.googlesource.com/a/platform/manifest(中间加上了“/a”)。
5. repo init -u https://android.googlesource.com/a/platform/manifest -b android-4.0.3_r1
6. repo sync
即可拉下Android源码。
官方的说法是:因为访问基本是匿名的,为了防止连接过多(指内网/虚拟机),对同一IP地址的连接数做了一定的限制。看来是用gmail帐号进行认证。
这样的话,在公司网络内或者用虚拟机下载的话,会经常遇到这问题。
源码官网指导网址: http://source.android.com/source/downloading.html
查看Android源码版本
- $ grep PLATFORM_VERSION build/core/version_defaults.mk
- # PLATFORM_VERSION
- # PLATFORM_VERSION_CODENAME
- ifeq "" "$(PLATFORM_VERSION)"
- PLATFORM_VERSION := 4.1.2
- # SDK version the branch is based on and PLATFORM_VERSION_CODENAME holds
- ifeq "" "$(PLATFORM_VERSION_CODENAME)"
- PLATFORM_VERSION_CODENAME := REL
- ifeq "REL" "$(PLATFORM_VERSION_CODENAME)"
- DEFAULT_APP_TARGET_SDK := $(PLATFORM_VERSION_CODENAME)
断网时自动进行repo sync继续下载android源码
症状分析: 在Android源码下载时,经常会断掉,这时,就得重新输入repo sync,那么,有没有一种方法在断网时自动进行repo sync呢?
解决对策:
vi repo_sync.sh
#!/bin/bash
repo sync
while [ $? -ne 0 ]
do
repo sync
done
ubuntu10.04 amd64 git版本升级,error: Exited sync due to gc errors
- ubuntu10.04出现error:Exited sync due to gc errors解决方法
- error: Exited sync due to gc errors 解决方法
- 原因: repo 升级,不兼容GIT 1.7.2 以下的版本。
- 升级git到 1.7.2以及以上的版本, 升级方法
- 增加ppa
- sudo apt-add-repository ppa:git-core/ppa
- sudo apt-get update
- sudo apt-get install git
- 如果本地已经安装过Git,可以使用升级命令:
- sudo apt-get dist-upgrade
- Android下载Android源码
- 下载构建android源码-下载源码
- Android源码下载
- Android源码下载
- android源码下载
- android源码下载
- git 下载 android 源码
- Android 源码下载
- Android 源码下载编译
- android源码下载
- android源码下载方法
- android git 下载源码
- 如何下载android源码
- android源码下载
- android源码下载
- android源码下载
- android 源码下载
- ubuntu android 源码下载
- 史上最详细的Android Studio系列教程三--快捷键
- Redis整合Spring项目搭建实例指导
- SQL 可以将表中数据转换成insert脚本的存储过程-spGenInsertSQLHan
- 一个旋转的亮圈
- Access denied for user 'root'@'localhost' (using password: YES)
- 下载Android 源码
- 获得Redirect后的url
- Linux_shell——第3章 以文件之名
- cocos2d-x 图片平移缩放组件
- 史上最详细的Android Studio系列教程四--Gradle基础
- 隐藏文件,文件夹显示或隐藏
- iOS 颜色制作背景图片
- 你可能不知道的Shell
- 写个html下载swf