Ubuntu 12.04(64位)下载并编译 Android 4.1 源码[只有2条命令]
====================================================
$ 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条命令]
====================================================
为了方便,我把所有操作写成了命令,按顺序(软件安装--源码下载--编译)执行成功即可:
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 新分支后,往往编译不通过,会出现如
build/core/base_rules.mk:128: *** dalvik/libcore: MODULE.TARGET.JAVA_LIBRARIES.core already defined by libcore. Stop.
这样的错误,这是因为你同步下来的是最新的分支 master,该分支中可能没有之前版本需要的项目,所以需要再做以下两步:
repo init -b <branch>
//比如我的:repo init -b froyo
repo sync
这样才得到完整的分支代码。
来源:oschina
链接:https://my.oschina.net/u/10896/blog/4083