第一步安装Sun Java jdk6(Android SDK依赖)
- # Ubuntu 11.10 and after
- Download Java from Oracle
- sudo mkdir /opt/java
- sudo mv ~/Downloads/jdk-6u29-linux-x64.bin
- sudo chmod +x ./jdk-6u29-linux-x64.bin
- sudo ./jdk-6u29-linux-x64.bin
- ln -f -s /opt/java/jdk1.6.0_29/bin/* /usr/local/bin/
- # something like sudo update-alternatives --install /usr/local/bin/java java /opt/java/jdk1.6.0_29/bin/ 1 is close to the distro way of registering java
- sudo apt-get install mercurial ccache
- sudo apt-get build-dep firefox
1.3)安装Android NDK
下载并提取Android NDK。NDK版本4-7已测试可用。编译人员当前用的是NDKr5c。
- wget http://dl.google.com/android/ndk/android-ndk-r5c-linux-x86.tar.bz2
- tar -xjf android-ndk-r5c-linux-x86.tar.bz2
wget下载和tar解压在了当前目录。pwd:~/env。
1.4)安装Android SDK
安装最新版本的Android SDK。会比较久,可以去喝杯咖啡,什么什么的==。
- wget http://dl.google.com/android/android-sdk_r13-linux_x86.tgz
- tar -xzf android-sdk_r13-linux_x86.tgz
- ./android-sdk-linux_x86/tools/android update sdk --no-ui
- ./android-sdk-linux_x86/tools/android update adb
最好配置下sdk tools的path,恩,是要加一下。
- gedit ~/.bashrc
- export PATH=$PATH:$HOME/env/android-sdk-linux/platform-tools:$HOME/env/android-sdk-linux/tools
- source ~/.bashrc
- draw9patch
1.5)增加链接速度(AKA using gold)
- sudo apt-get install bison flex (or equivalent for your distribution)
- mkdir ~/gold; pushd ~/gold
- wget http://ftp.gnu.org/gnu/binutils/binutils-2.22.tar.bz2
- tar xfj binutils-2.22.tar.bz2
- mkdir binutils-build; pushd binutils-build
- ../binutils-2.22/configure --target=arm-linux-androideabi --prefix=$HOME/gold/arm-linux-androideabi --enable-gold --disable-werror
- make
- make install
- popd
- cd arm-linux-androideabi/bin/
- ./arm-linux-androideabi-ld.gold --version
和通常一样编译(make -f client.mk),只是要用设定不同的mozconfig。
- cd ~/env(先切换下目录)
- hg clone http://hg.mozilla.org/mozilla-central/ src
- cd src
- gedit mozconfig-droid(vi不熟的,路过~)
- # Add the correct paths here:
- ac_add_options --with-android-ndk="$HOME/env/android-ndk-r5c"
- ac_add_options --with-android-sdk="$HOME/env/android-sdk-linux/platforms/android-13"
- ac_add_options --with-android-version=5
- # android options
- ac_add_options --enable-application=mobile/android
- ac_add_options --target=arm-linux-androideabi
- ac_add_options --with-ccache
- ac_add_options --enable-tests
- mk_add_options MOZ_OBJDIR=./objdir-droid
- mk_add_options MOZ_MAKE_FLAGS="-j9 -s"
- export MOZCONFIG=~/env/src/mozconfig-droid
- cd ~/env/src
- make -f client.mk build_and_deploy
- cd objdir-droid/dist/
- ls fen*
- adb install -r fennec*.apk
ps:Fennec支持Adobe Flash Player,不过需要注意以下特别说明:
Adobe Flash针对Android采用了分版本策略,Android 4.0和较低的系统版本分别使用不同的Adobe Flash,这次更新仅针对Android 4.0系统升至11.1.112.61,其他设备的Flash仍然保留在11.1.111.5(摘自:http://www.cr173.com/soft/16050.html)