Ubuntu 12.04(64位)下載並編譯 Android 4.1 源碼[只有2條命令]
==================================================== java
$ sudo apt-get install git-core gnupg flex bison gperf build-essential \ zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \ libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 \ libgl1-mesa-dev g++-multilib mingw32 openjdk-6-jdk tofrodos \ python-markdown libxml2-utils xsltproc zlib1g-dev:i386 $ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
Ubuntu 10.04(64位)下載並編譯 Android 2.2 源碼[只有11條命令]
==================================================== python
爲了方便,我把全部操做寫成了命令,按順序(軟件安裝--源碼下載--編譯)執行成功便可: linux
sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev \ gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev ia32-libs x11proto-core-dev \ libx11-dev lib32readline5-dev lib32z-dev java-common unixodbc sudo apt-get install sun-java6-jdk cd mkdir -p software/bin curl http://android.git.kernel.org/repo >software/bin/repo chmod a+x software/bin/repo mkdir -p software/android/src/new cd software/android/src/new repo init -u git://android.git.kernel.org/platform/manifest.git -b froyo repo sync make -j4
若是下載的是 master 分支,在 Checkout 新分支後,每每編譯不經過,會出現如 android
build/core/base_rules.mk:128: *** dalvik/libcore: MODULE.TARGET.JAVA_LIBRARIES.core already defined by libcore. Stop. git
這樣的錯誤,這是由於你同步下來的是最新的分支 master,該分支中可能沒有以前版本須要的項目,因此須要再作如下兩步: shell
repo init -b <branch> //好比個人:repo init -b froyo repo sync
這樣才獲得完整的分支代碼。 markdown