ubuntu下载android4.1源码------重传脚本很有效
来源:互联网 发布:ubuntu怎么用中文 编辑:程序博客网 时间:2024/04/20 11:21
详细手册参见:http://source.android.com/source/index.html
1、搭建下载和编译环境
①安装sun-java6-jdk,由于ubuntu官方软件源中已经不包含sun-java6-jdk,需要自己下载安装
②安装相关包,
32bit系统如下:
64bit系统如下:
2、下载源码
①Installing Repo
Make sure you have a bin/ directory in your home directory, and that it is included in your path:
Download the Repo script and ensure it is executable:
②Initializing a Repo client
Create an empty directory to hold your working files. If you're using MacOS, this has to be on a case-sensitive filesystem. Give it any name you like:
Run repo init to bring down the latest version of Repo with all its most recent bug fixes. You must specify a URL for the manifest, which specifies where the various repositories included in the Android source will be placed within your working directory.
To check out a branch other than "master", specify it with -b:
Android相关版本以及分支信息参见:http://source.android.com/source/build-numbers.html
③Getting the files
To pull down files to your working directory from the repositories as specified in the default manifest, run
出现问题如下:
1、执行repo sync后,提示使用git-core 1.7.2或者更高版本,然后使用ubuntu 10.04的sudo apt-get install git-core安装的版本为1.7.0
解决方法:
打开bin目录下的repo文件,将以下语句
2、总是提示http请求失败
error: Failed to connect to 2404:6800:4008:c01::52: Network is unreachable while accessing https://android.googlesource.com/platform/frameworks/compile/libbcc/info/refs
fatal: HTTP request failed
error: Failed to connect to 2404:6800:4008:c01::52: Network is unreachable while accessing https://android.googlesource.com/platform/frameworks/compile/linkloader/info/refs
fatal: HTTP request failed
解决方法:
Using authentication
Google官方指出服务器访问基本是匿名的,为了防止连接过多(指内网/虚拟机),对同一IP地址的连接数做了一定的限制。看来是用gmail帐号进行认证。这样的话,在公司网络内或者用虚拟机下载的话,会经常遇到下载失败的问题。
The first step is to create a password from [https://android.googlesource.com/new-password] 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:
3、出现在下载过程中卡住的问题
解决方法:
结束此次下载后重新执行 $repo sync
=============== end =================
PS:在下载过程中出现下载失败时,再次执行repo sync就行了。
为了使用方便,可以使用shell脚本循环执行(shell脚本中的$?表示上一个命令的执行结果)
1、搭建下载和编译环境
①安装sun-java6-jdk,由于ubuntu官方软件源中已经不包含sun-java6-jdk,需要自己下载安装
②安装相关包,
32bit系统如下:
- $ sudo apt-get install git-core gnupg flex bison gperf build-essential \
- zip curl zlib1g-dev libc6-dev libncurses5-dev \
- x11proto-core-dev libx11-dev libreadline5-dev libz-dev \
- libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown \
- libxml2-utils xsltproc
$ sudo apt-get install git-core gnupg flex bison gperf build-essential \zip curl zlib1g-dev libc6-dev libncurses5-dev \x11proto-core-dev libx11-dev libreadline5-dev libz-dev \libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown \libxml2-utils xsltproc
64bit系统如下:
- $ sudo apt-get install git-core gnupg flex bison gperf build-essential \
- zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs \
- x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev \
- libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown \
- libxml2-utils xsltproc
$ sudo apt-get install git-core gnupg flex bison gperf build-essential \zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs \x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev \libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown \libxml2-utils xsltproc
2、下载源码
①Installing Repo
Make sure you have a bin/ directory in your home directory, and that it is included in your path:
- $ mkdir ~/bin
- $ PATH=~/bin:$PATH
$ mkdir ~/bin$ PATH=~/bin:$PATH
Download the Repo script and ensure it is executable:
- $ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
- $ chmod a+x ~/bin/repo
$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo$ chmod a+x ~/bin/repo
②Initializing a Repo client
Create an empty directory to hold your working files. If you're using MacOS, this has to be on a case-sensitive filesystem. Give it any name you like:
- $ mkdir WORKING_DIRECTORY
- $ cd WORKING_DIRECTORY
$ mkdir WORKING_DIRECTORY$ cd WORKING_DIRECTORY
Run repo init to bring down the latest version of Repo with all its most recent bug fixes. You must specify a URL for the manifest, which specifies where the various repositories included in the Android source will be placed within your working directory.
- $ repo init -u https://android.googlesource.com/platform/manifest
$ 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
$ repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.1_r1
Android相关版本以及分支信息参见:http://source.android.com/source/build-numbers.html
③Getting the files
To pull down files to your working directory from the repositories as specified in the default manifest, run
- $ repo sync
$ repo sync
出现问题如下:
1、执行repo sync后,提示使用git-core 1.7.2或者更高版本,然后使用ubuntu 10.04的sudo apt-get install git-core安装的版本为1.7.0
解决方法:
打开bin目录下的repo文件,将以下语句
- MIN_GIT_VERSION = (1, 7, 2) # minimum supported git version
MIN_GIT_VERSION = (1, 7, 2) # minimum supported git version改为:
- MIN_GIT_VERSION = (1, 7, 0) # minimum supported git version
MIN_GIT_VERSION = (1, 7, 0) # minimum supported git version
2、总是提示http请求失败
error: Failed to connect to 2404:6800:4008:c01::52: Network is unreachable while accessing https://android.googlesource.com/platform/frameworks/compile/libbcc/info/refs
fatal: HTTP request failed
error: Failed to connect to 2404:6800:4008:c01::52: Network is unreachable while accessing https://android.googlesource.com/platform/frameworks/compile/linkloader/info/refs
fatal: HTTP request failed
解决方法:
Using authentication
Google官方指出服务器访问基本是匿名的,为了防止连接过多(指内网/虚拟机),对同一IP地址的连接数做了一定的限制。看来是用gmail帐号进行认证。这样的话,在公司网络内或者用虚拟机下载的话,会经常遇到下载失败的问题。
The first step is to create a password from [https://android.googlesource.com/new-password] 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
$ repo init -u https://android.googlesource.com/a/platform/manifest
3、出现在下载过程中卡住的问题
解决方法:
结束此次下载后重新执行 $repo sync
=============== end =================
PS:在下载过程中出现下载失败时,再次执行repo sync就行了。
为了使用方便,可以使用shell脚本循环执行(shell脚本中的$?表示上一个命令的执行结果)
- #!/bin/bash
- echo "======start repo sync======"
- repo sync
- while [ $? == 1 ]; do
- echo "======sync failed, re-sync again======"
- sleep 3
- repo sync
- done
#!/bin/bash echo "======start repo sync======" repo sync while [ $? == 1 ]; do echo "======sync failed, re-sync again======" sleep 3 repo sync done
经过一晚上的下载终于还是成功了~~~
- ubuntu下载android4.1源码------重传脚本很有效
- 下载Android4.1源码
- android4.1源码下载
- Ubuntu 10.04 下载android4.2 源码
- Ubuntu 10.04 下载android4.2 源码
- android4.1源码下载方法
- Ubuntu下Android4.0源码的下载和编译
- Ubuntu下Android4.0源码的下载和编译
- Ubuntu下Android4.0源码的下载和编译
- Ubuntu下Android4.0源码的下载和编译
- Ubuntu下Android4.0源码的下载和编译
- 64位Ubuntu下下载编译Android4.3源码
- Ubuntu下Android4.4源码--下载与编译
- 在Ubuntu上下载Google Android4.4源码
- Android4.2.1源码下载
- android4.3源码下载
- android4.4源码下载
- 下载Android4.4源码
- 数据结构学习笔记--(1)数据结构知识点
- Android R文件不能自动代码的原因
- NumPy简明教程(一、简介)
- uva-272
- 如何写好一个专栏?
- ubuntu下载android4.1源码------重传脚本很有效
- 苦逼翻滚之实习找工记事-产品岗(3.18-4.23长文慎入)
- 总结:linux运行级别和终端切换
- js控制图片定时切换不限制数量
- android compile system
- go run的一个小细节
- 网页布局--网页分辨率与百分比的区别
- 判断无向图是否有回路
- 解决android:layout_marginBottom在RelativeLayout中无效的问题