Android源代码下载步骤官网地址:http://source.android.com/source/downloading.html
1.下载Android源代码需要安装的库
$sudo apt-get install git-core gnupg flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev
JDK版本:1.6 (推荐)
2.根据官方文档下载源代码
Repo is a tool that makes it easier to work with Git in the context of Android. For more information about Repo, seeVersion Control.
To install, initialize, and configure Repo, follow these steps:
Make sure you have a bin/ directory in your home directory, and that it is included in your 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
For version 1.17, the SHA-1 checksum for repo is ddd79b6d5a7807e911b524cb223bc3544b661c28
After installing Repo, set up your client to access the android source repository:
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
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
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
When prompted, please configure Repo with your real name and email address. To use the Gerrit code-review tool, you will need an email address that is connected with aregistered Google account. Make sure this is a live address at which you can receive messages. The name that you provide here will show up in attributions for your code submissions.
A successful initialization will end with a message stating that Repo is initialized in your working directory. Your client directory should now contain a.repo
directory where files such as the manifest will be kept.
说明:下载源代码时会出现repo或同步源代码异常下载不了的情况,很有可能就是IP被墙,可以隔段时间在试试~当然人品大暴发的时候一次可能就很顺利的下载成功了!
To pull down files to your working directory from the repositories as specified in the default manifest, run
$ repo sync
3.Android源代码编译 到源代码下载目录执行make或make -j2(2表示下载线程数)
4.祝你成功
完毕.....