unbuntu编译firefox for android

2015-04-20 13:14:00
zengde
原创 474

接此篇windows下编译firefox37

所需环境,android sdk需包含support library和google play service,ndk r8e,

在firefox根目录创建mozconfig文件,文件内容为:


# Build Firefox for Android:
ac_add_options --enable-application=mobile/android
ac_add_options --target=arm-linux-androideabi
#ac_add_options --with-android-version=21
#ac_add_options --with-ccache

# With the following Android SDK and NDK:
ac_add_options --with-android-sdk="/home/firefox-dev/android/android-sdk-linux/platforms/android-21"
ac_add_options --with-android-ndk="/home/firefox-dev/android/android-ndk-r8e"
ac_add_options --with-android-toolchain="/home/firefox-dev/android/android-ndk-r8e/toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86_64"

#HOST_CC="D:/command/cygwin64/bin/gcc"
#HOST_CXX="D:/command/cygwin64/bin/g++"

mk_add_options MOZ_OBJDIR=./obj-android

如果是x86,需要改

ac_add_options --target=i386-linux-android

接着:

./mach build
./mach package
这时在./obj-android/dist/下有个gecko.apk文件


如果要生成android studio或eclipse项目的话,

1.as

./mach gradle-install
打开as,File > Import Project.,选择obj-android/mobile/android/gradle完成。


2.eclipse

安装插件,地址

https://people.mozilla.org/~nalexander/eclipse/update-site/
然后
mach build-backend -b=AndroidEclipse

在eclipse中导入项目,File > Import... 选择 General > Existing Projects into Workspace,目录为mach build-backend.输出的obj-android/android-eclipse,勾选以下项目

  • Fennec
  • FennecOmnijar
  • FennecResources
  • FennecResourcesBranding
  • FennecResourcesGenerated
  • appcompat
  • FennecResourcesCrashReporter
  • FennecResourcesStatic
  • FennecStumbler
  • google-play-services_lib
  • mediarouter
  • Robocop



博客分类