2010/08/03

android build on ubuntu 10.04

Dependance
  • 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 libsdl-dev libesd0-dev
Java
  • sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
    sudo apt-get update
    sudo apt-get install sun-java6-jdk
Source Code
  • curl http://android.git.kernel.org/repo > ~/bin/repo
  • chmod a+x ~/bin/repo
  • mkdir -p ~/src/android
  • cd ~/src/android
  • repo init -u git://android.git.kernel.org/platform/manifest.git
  • repo sync
  • repo forall -c git checkout --track -b sai-master korg/master
Environment
  • export JAVA_HOME=/usr/lib/jvm/java-6-sun/
    export PATH=$PATH:${JAVA_HOME}/bin:$HOME/src/android/android-sdk-linux_86/tools:$HOME/src/android/out/host/linux-x86/bin
    export ANDROID_PRODUCT_OUT=$HOME/src/android/out/target/product/generic
  • chmod a+x build/envsetup.sh
  • source build/envsetup.sh
Build
  • make -j4
Run
  • export DISPLAY=:0.0
    #ps: 如果沒有設定 DISPLAY, 會顯示的訊息跟一般的 X app 不一樣,如下:
    SDL init failure, reason is: No available video device
  • emulator -system system.img -data userdata.img -ramdisk ramdisk.img

0 意見: