1、安裝jdk6
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install Oracle-java6-installer
2、安裝必需的Ubuntu安裝包
sudo apt-get install build-essential default-jdk git-core curl autoconf \
unzip zip zlib1g-dev gawk gperf cmake
3、安裝Android SDK
a. 進入下載頁面http://dl.google.com/android/android-sdk_r14-linux.tgz下載android-sdk_r14-linux.tgz到目錄/opt
b. 解壓android-sdk_r14-linux.tgz到/opt/android-sdk-linux/
c. 下載android sdk 離線包android-14_r03.zip,並解壓到/opt/android-sdk-linux/platforms/android-14
d. 下載離線包platform-tools_r14-linux.zip,並解壓到/opt/android-sdk-linux/platform-tools
4、安裝android NDK
進入下載頁面dl.google.com/android/ndk/android-ndk-r8e-linux-x86.tar.bz2下載android-ndk-r8e-linux-x86.tar.bz2到目錄/opt/android-ndk-r8e
5、安裝android工具鏈For XBMC
cd /opt/android-ndk-r8e
ls platforms
cd build/tools
./make-standalone-toolchain.sh --ndk-dir=../../ \
--install-dir=../../../android-toolchain/android-14 --platform=android-14 \
--toolchain=arm-linux-androideabi-4.7
6、創建一個debug key 來簽名debug apk
keytool -genkey -keystore ~/.android/debug.keystore -v -alias androiddebugkey -dname "CN=Android Debug,O=Android,C=US" -keypass android -storepass android -keyalg RSA -keysize 2048 -validity 10000
7、獲取XBMC源碼
cd $HOME
git clone git://github.com/xbmc/xbmc.git xbmc-android
cd xbmc-android
git submodule update --init addons/skin.touched
8、編譯XBMC依賴庫
cd $HOME/xbmc-android/tools/depends
./bootstrap
./configure --with-toolchain=/opt/android-toolchain/android-14 --prefix=/opt/xbmc-deps --host=arm-linux-androideabi --with-sdk-path=/opt/android-sdk-linux --with-ndk=/opt/android-ndk-r8e --with-sdk=android-14 --with-tarballs=/tmp/xbmc-android
make -j 20
9、編譯XBMC源碼
cd $HOME/xbmc-android
make -C tools/depends/target/xbmc
make
make apk
10、安裝生成的xbmc apk包到android設備
cd $HOME/xbmc-android
adb devices
adb -s 02efd7ab install -r ./xbmcapp-armeabi-v7a-debug.apk
注:02efd7ab 是設備id,可通過adb devices命令獲得