您的位置:首页 > 移动开发 > Android开发

学习记录: android 源码的下载_探究(一)

2012-06-08 00:05 399 查看
下载android源码步骤:

一. 环境准备。

1. 安装Git工具。Android源代码采用Git工具来管理,与SVN相比,这是一种分布式的源代码管理工具,而SVN是集中式的源代码管理工具。要安装Git工具,在Ubuntu上执行以下命令即可:

USER-NAME@MACHINE-NAME:~$ sudo apt-get install git-core gnupg

2. 安装Java SDK。在Ubuntu上执行以下命令:

USER-NAME@MACHINE-NAME:~$
sudo add-apt-repository ppa:ferramroberto/java

USER-NAME@MACHINE-NAME:~$

sudo apt-get update

USER-NAME@MACHINE-NAME:~$
sudo apt-get install sun-java6-jre sun-java6-plugin

USER-NAME@MACHINE-NAME:~$
sudo apt-get install sun-java6-jdk

安装过程中,出现某些更新软件失败,但是通过更新了 软件源之后,即OK了。


3. 依赖的其它包。在Ubuntu上执行以下命令:

USER-NAME@MACHINE-NAME:~$ sudo apt-get install flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl
4. 调试工具。在Ubuntu上执行以下命令:

USER-NAME@MACHINE-NAME:~$ sudo apt-get install valgrind

二. 下载Android源代码工程

1. [b]下载repo工具。在Ubuntu上执行以下命令:[/b]

USER-NAME@MACHINE-NAME:~$ wget http://android.git.kernel.org/repo

USER-NAME@MACHINE-NAME:~$ chmod 777 repo
USER-NAME@MACHINE-NAME:~$ cp repo /bin/

2. 下载Android最新版本源代码。在Ubuntu上执行以下命令:

USER-NAME@MACHINE-NAME:~$ mkdir Android

USER-NAME@MACHINE-NAME:~$ cd Android
[b]USER-NAME@MACHINE-NAME:~/Android$ repo init -u git://[/b]android.git.kernel.org/platform/manifest.git
[b]USER-NAME@MACHINE-NAME:~/Android$ repo sync -j 8
[/b]
经过漫长的等待(我下载了两三天)后,就可以把Android源代码下载下来了。其间可能还有经历下载中断的情况,这时只要重新执行repo sync就可以了。


>>>但是由于最新 kernel.org 无法访问,导致下载失败,所以需要更新新的repo 如下:


//======================================引用===================================//


无意间在网上看到这篇文章,从另一个repo库下载Android代码,我还没有试过,下面是具体步骤:

I will describe another way to get the Android source codes if you
hadn’t already cloned it’s repo before kernel.org servers went down.

Prepare the environment

Artur Graniszewski的博客下载repo脚本

First, you need to download “repo” script from
kernel.org my blog (please, enclose the URL address in double quotes):

curl "http://php.webtutor.pl/en/wp-content/uploads/2011/09/repo" > ~/bin/repo

chmod a+x ~/bin/repo

PATH=~/bin:$PATH




Download the Android repository

下载Android源代码,如下

Now, you can safely download the repository, like so:

mkdir WORKING_DIRECTORY

cd WORKING_DIRECTORY

repo init -u git://codeaurora.org/platform/manifest.git -b gingerbread

repo sync


完成之后就可以进行开发工作了。

and start the development…



文章地址:http://php.webtutor.pl/en/2011/09/05/kernel-org-hacked-how-to-get-android-repo/


//======================================引用===================================//
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: