1. 安装必须的工具-----------------------------------------------------------------------------------------------------------------------------------------------------------------sudo apt-get install git-core gnupg sun-java6-jdk flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev-----------------------------------------------------------------------------------------------------------------------------------------------------------------2. 配置Java 环境-----------------------------------------------------------------------------------------------------------------------------------------------------------------sudo update-java-alternatives -s java-6-sun sudo vi /etc/jvm 在最上面一行加上 /usr/lib/jvm/java-6-sun -----------------------------------------------------------------------------------------------------------------------------------------------------------------3. 取得repo脚本,用来得代码-----------------------------------------------------------------------------------------------------------------------------------------------------------------cd ~;mkdir bin;export PATH=~/bin:$PATH; curl http://android.git.kernel.org/repo >~/bin/repo ; chmod a+x ~/bin/repo-----------------------------------------------------------------------------------------------------------------------------------------------------------------4. 建立工程目录并抓取Android源代码-----------------------------------------------------------------------------------------------------------------------------------------------------------------mkdir androidcd androidrepo init -u git://android.git.kernel.org/platform/manifest.gitrepo sync