Adroid offical 参考编译环境
-- http://source.android.com/source/initializing.html
(1) 检查环境所需的工具
--- Requirement(通过以下命令进行检查):
Python 2.5 -- 2.7,
$ python --version
GNU Make 3.81 – 3.82,
$ make --version
JDK 6
$ java -version
Git 1.7 or newer
$ git --version
(2) 安装JDK
$ sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
$ sudo apt-get update
$ sudo apt-get install sun-java6-jdk
(3) 安装所需的其它软件
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
(4) 可选择性地安装以下软件
$ sudo apt-get install vim
$ sudo apt-get install minicom
(5) 安装repo(用于下载源码)
Step 1: Make sure you have a bin/ directory in your home directory, and that it is included
in your path:
$ mkdir ~/bin
$ PATH=~/bin:$PATH
Step 2: 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
(6) 安装repo client并获取源码
安装完repo后,需要创建client端来进入android source repository.
$ mkdir jellybean_src
$ cd jellybean_src
repo init -u https://android.googlesource.com/platform/manifest -b android-4.1.1_r4 (注意,如果有问题,试试http://...,不用https://...)$
$ repo sync