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. 进入下载页面下载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命令获得