1、安装jdk1.6
-
chmod u+x jdk-6u45-linux-x64.bin
-
./jdk-6u45-linux-x64.bin
-
sudo mv jdk1.6.0_45 /opt
然后配置环境
-
vi ~/.bashrc
-
export JAVA_HOME=/opt/jdk1.6.0_45
-
export JRE_HOME=$JAVA_HOME/jre
-
export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib”$CLASSPATH
-
export PATH=:$JAVA_HOME/bin:$JRE_HOME:$PATH (这里JAVA目录最好在PATH前面)
2、安装环境
-
sudo apt-get install git 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 tofrodos \
-
python-markdown libxml2-utils xsltproc zlib1g-dev:i386
3、编译android源代码
4、编译好后需要模拟运行
在android目录下会生成out文件夹
-
cd ~/android/out/target/product/generic
-
emulator -system system.img -data userdata.img -ramdisk ramdisk.img
在此之前需要配置android编译出来的环境
-
export ANDROID_PRODUCT_OUT=~/android/out/target/product/generic
-
export ANDROID_PRODUCT_OUT_BIN=~/android/out/host/linux-x86/bin
-
export PATH=${PATH}:${ANDROID_PRODUCT_OUT}:${ANDROID_PRODUCT_OUT_BIN}
-
export ANDROID_SWT=~/android/out/host/linux-x86/framwork
-
export ANDROID_BUILD_TOP=~/android
特别注意:
Android 4.2.2 需要在ubuntu64位下编译
编译环境需要2G以上的内存
阅读(954) | 评论(0) | 转发(0) |