<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.mozilla.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Wchen</id>
	<title>MozillaWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.mozilla.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Wchen"/>
	<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/Special:Contributions/Wchen"/>
	<updated>2026-09-04T19:56:51Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.10</generator>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Mobile/Fennec/Android&amp;diff=638185</id>
		<title>Mobile/Fennec/Android</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Mobile/Fennec/Android&amp;diff=638185"/>
		<updated>2013-03-18T23:11:01Z</updated>

		<summary type="html">&lt;p&gt;Wchen: /* Setup Fennec mozconfig */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Building Fennec ==&lt;br /&gt;
&lt;br /&gt;
First follow the platform-specific instructions below to set up a build environment on your machine. Once you have done that, follow the steps to get the source code, set up your mozconfig, and build Fennec.&lt;br /&gt;
&lt;br /&gt;
Also, the [https://wiki.mozilla.org/Mobile/Fennec/Android_OtherBuildEnvs OtherBuildEnvs page] has some notes on a few other environment variations, so take a look at that as well if you have an environment or configuration that deviates from &amp;quot;normal&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Windows (using Linux VM) ===&lt;br /&gt;
&lt;br /&gt;
It is not currently possible to compile Fennec on Windows. If you have a Windows PC, see these posts for a Linux virtual machine to compile Fennec:&lt;br /&gt;
&lt;br /&gt;
* http://blog.lassey.us/2010/07/09/android-development-vm/&lt;br /&gt;
* http://blog.lassey.us/2011/07/22/updated-android-development-vm/&lt;br /&gt;
** Username: mozilla, password: hacker&lt;br /&gt;
** The archive contains a VMWare virtual machine; if you&#039;re using VirtualBox, you need to create a new VM (ideally with multiple processors and &amp;gt;= 4GB RAM) and reuse the disk image (Ubuntu.vmdk) from the archive.&lt;br /&gt;
** As of January 2013, you need to run the following in a terminal inside the VM in order to make the VM build the latest Fennec,&lt;br /&gt;
 # remove old SDK and install latest SDK:&lt;br /&gt;
 cd ~&lt;br /&gt;
 rm -rf android-sdk-linux_x86&lt;br /&gt;
 wget http://dl.google.com/android/android-sdk_r21.0.1-linux.tgz&lt;br /&gt;
 tar -xf android-sdk_r21.0.1-linux.tgz&lt;br /&gt;
 android-sdk-linux_x86/tools/android&lt;br /&gt;
 # install &amp;quot;Android SDK Tools&amp;quot;&lt;br /&gt;
 # install &amp;quot;Android SDK Platform-tools&amp;quot;&lt;br /&gt;
 # install &amp;quot;API 17 / SDK Platform&amp;quot;&lt;br /&gt;
 # install &amp;quot;Extras / Android Support Library&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # install Python 2.7&lt;br /&gt;
 cd ~&lt;br /&gt;
 sudo sh -c &#039;echo &amp;quot;deb http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu lucid main&amp;quot; &amp;gt;&amp;gt; /etc/apt/sources.list&#039;&lt;br /&gt;
 sudo sh -c &#039;echo &amp;quot;deb-src http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu lucid main&amp;quot; &amp;gt;&amp;gt; /etc/apt/sources.list&#039;&lt;br /&gt;
 sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys DB82666C&lt;br /&gt;
 sudo apt-get update&lt;br /&gt;
 sudo apt-get install python2.7 python2.7-dev&lt;br /&gt;
 wget http://python-distribute.org/distribute_setup.py&lt;br /&gt;
 sudo python2.7 distribute_setup.py&lt;br /&gt;
 sudo easy_install-2.7 pip&lt;br /&gt;
 sudo pip-2.7 install virtualenv&lt;br /&gt;
 &lt;br /&gt;
 # update configuration&lt;br /&gt;
 cd ~/src/mozilla-central&lt;br /&gt;
 hg pull -u&lt;br /&gt;
 # set &amp;quot;with-android-sdk&amp;quot; to &amp;quot;android-17&amp;quot; and &amp;quot;enable-application&amp;quot; to &amp;quot;mobile/android&amp;quot;&lt;br /&gt;
 sed -e &#039;s/android-8/android-17/&#039; -e &#039;s/mobile$/mobile\/android/&#039; mozconfig &amp;gt; mozconfig&lt;br /&gt;
 &lt;br /&gt;
 # build&lt;br /&gt;
 rm -rf objdir-droid&lt;br /&gt;
 export PYTHON=python2.7&lt;br /&gt;
 make -f client.mk build&lt;br /&gt;
 make -C objdir-droid package&lt;br /&gt;
&lt;br /&gt;
=== Linux ===&lt;br /&gt;
&lt;br /&gt;
==== Quick Script ====&lt;br /&gt;
&lt;br /&gt;
Here is a quick script to get set up. It is explained in more detail below.&lt;br /&gt;
&lt;br /&gt;
 # ensure that the &amp;quot;partner&amp;quot; repositories are enabled in /etc/apt/sources.list, or sun-java6-jdk won&#039;t be found&lt;br /&gt;
 # In Ubuntu 11.10 Java has been removed from partner, but&lt;br /&gt;
 # can be downloaded from Oracle at &lt;br /&gt;
 # http://www.oracle.com/technetwork/java/javase/downloads/index.html&lt;br /&gt;
 sudo apt-get update&lt;br /&gt;
 sudo apt-get install sun-java6-jdk mercurial ccache&lt;br /&gt;
 sudo apt-get build-dep firefox&lt;br /&gt;
 wget http://dl.google.com/android/ndk/android-ndk-r8c-linux-x86.tar.bz2&lt;br /&gt;
 tar -xjf android-ndk-r8c-linux-x86.tar.bz2&lt;br /&gt;
 wget http://dl.google.com/android/android-sdk_r20.0.3-linux.tgz&lt;br /&gt;
 tar -xzf android-sdk_r20.0.3-linux.tgz&lt;br /&gt;
 ./android-sdk-linux/tools/android update sdk -u&lt;br /&gt;
 ./android-sdk-linux/tools/android update adb&lt;br /&gt;
&lt;br /&gt;
If you&#039;re using a 64-bit Debian or Ubuntu install, you&#039;ll need ia32-libs to allow the toolchain binaries to run.  Otherwise you may get a &amp;quot;bash: file not found&amp;quot; error when trying to use any of the SDK/NDK tools.&lt;br /&gt;
&lt;br /&gt;
  # On recent Debian or Ubuntu you may need to run &amp;quot;sudo dpkg --add-architecture i386&amp;quot; first.&lt;br /&gt;
  # For details see: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=697924&lt;br /&gt;
  sudo apt-get install ia32-libs&lt;br /&gt;
&lt;br /&gt;
If you&#039;re using 64-bit Fedora install&lt;br /&gt;
&lt;br /&gt;
  yum install glibc-devel.i686 ncurses-libs-devel.i686 libstdc++-devel.i686 zlib-devel.i686&lt;br /&gt;
&lt;br /&gt;
==== Explained ====&lt;br /&gt;
&lt;br /&gt;
This section describes in greater detail all the dependencies and requirements of getting a working build environment on Linux.&lt;br /&gt;
&lt;br /&gt;
===== Install Java =====&lt;br /&gt;
&lt;br /&gt;
First install the Sun Java jdk6, which the Android SDK depends on. If you&#039;re on Ubuntu (pre-11.10), you&#039;ll need to [https://help.ubuntu.com/community/Repositories/Ubuntu#Adding_Canonical_Partner_Repositories enable the partners repo] to get it. Java 7 should work, although occasionally breaks (java 6 is what the buildbots use, so that&#039;s the &amp;quot;officially supported&amp;quot; one).&lt;br /&gt;
&lt;br /&gt;
 # Ubuntu pre-11.10&lt;br /&gt;
 sudo apt-get update&lt;br /&gt;
 sudo apt-get install sun-java6-jdk&lt;br /&gt;
 sudo update-java-alternatives -s java-6-sun&lt;br /&gt;
&lt;br /&gt;
 # Ubuntu 11.10 and after&lt;br /&gt;
 # Download Java from Oracle - go to http://www.oracle.com/technetwork/java/javase/downloads/index.html and&lt;br /&gt;
 # download the latest version of the JDK.&lt;br /&gt;
 # These instructions assume the file is called jdk-6u35-linux-x64.bin&lt;br /&gt;
 sudo mkdir /opt/java&lt;br /&gt;
 sudo mv ~/Downloads/jdk-6u35-linux-x64.bin&lt;br /&gt;
 sudo chmod +x ./jdk-6u35-linux-x64.bin&lt;br /&gt;
 sudo ./jdk-6u35-linux-x64.bin&lt;br /&gt;
 ln -f -s /opt/java/jdk1.6.0_35/bin/* /usr/local/bin/&lt;br /&gt;
 # something like sudo update-alternatives --install /usr/local/bin/java java /opt/java/jdk1.6.0_35/bin/ 1 is&lt;br /&gt;
 # close to the distro way of registering java&lt;br /&gt;
&lt;br /&gt;
If you&#039;re on Ubuntu 64-bit, you&#039;ll also want to install ia32-libs at this point (things like adb won&#039;t work until you do):&lt;br /&gt;
&lt;br /&gt;
  apt-get install -y ia32-libs&lt;br /&gt;
&lt;br /&gt;
===== Install Gecko Requirements =====&lt;br /&gt;
&lt;br /&gt;
Then install the usual stuff needed for a firefox build.&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install mercurial ccache&lt;br /&gt;
 sudo apt-get build-dep firefox&lt;br /&gt;
&lt;br /&gt;
===== Install Android NDK =====&lt;br /&gt;
&lt;br /&gt;
Download and extract the [http://developer.android.com/sdk/ndk/ Android NDK]. NDK revs 4-8 (except r8d) have been tested and are known to work. The automated builders currently use version r8c. r8d does NOT work (see {{bug|825968}}).&lt;br /&gt;
&lt;br /&gt;
 wget http://dl.google.com/android/ndk/android-ndk-r8c-linux-x86.tar.bz2&lt;br /&gt;
 tar -xjf android-ndk-r8c-linux-x86.tar.bz2&lt;br /&gt;
&lt;br /&gt;
===== Install Android SDK =====&lt;br /&gt;
&lt;br /&gt;
You should just install the latest [http://developer.android.com/sdk/ Android SDK], we set the API level in our manifest files.  The sdk download will take a while, make sure you have a decent internet connection and go get coffee, or maybe lunch.&lt;br /&gt;
&lt;br /&gt;
You will need SDK version at least 16.&lt;br /&gt;
&lt;br /&gt;
 wget http://dl.google.com/android/android-sdk_r20.0.3-linux.tgz&lt;br /&gt;
 tar -xzf android-sdk_r20.0.3-linux.tgz&lt;br /&gt;
 ./android-sdk-linux/tools/android update sdk --no-ui&lt;br /&gt;
 ./android-sdk-linux/tools/android update adb&lt;br /&gt;
&lt;br /&gt;
You will probably want to add the SDK&#039;s &amp;quot;tools&amp;quot; and &amp;quot;platform-tools&amp;quot; directory to the PATH environment variable in your shell, so that you can run [http://developer.android.com/guide/developing/tools/adb.html adb] and other tools easily. For example, if you installed the SDK in $HOME/opt, you could add the following line to the end of your .bashrc:&lt;br /&gt;
&lt;br /&gt;
  export PATH=$PATH:$HOME/opt/android-sdk-linux/platform-tools:$HOME/opt/android-sdk-linux/tools&lt;br /&gt;
&lt;br /&gt;
=== Mac OS X ===&lt;br /&gt;
&lt;br /&gt;
To set up a build environment on Mac OS X, you first need to install XCode and a few supplementary build tools via a package manager. To do this, follow steps 1 and 2 of the [https://developer.mozilla.org/en-US/docs/Developer_Guide/Build_Instructions/Mac_OS_X_Prerequisites Mac OS X Build Prerequisites page]. Once you have completed steps 1 and 2, come back here and continue with the instructions below.&lt;br /&gt;
&lt;br /&gt;
After installing XCode make sure you also have wget installed. If wget is not a recognized command in terminal follow these steps to install it:&lt;br /&gt;
&lt;br /&gt;
 curl -O http://ftp.gnu.org/gnu/wget/wget-1.14.tar.gz&lt;br /&gt;
 tar -xzvf wget-1.14.tar.gz&lt;br /&gt;
 cd wget-1.14&lt;br /&gt;
 ./configure --with-ssl=openssl&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
 which wget #Should output: /usr/local/bin/wget&lt;br /&gt;
&lt;br /&gt;
===== Install ccache =====&lt;br /&gt;
&lt;br /&gt;
You can optionally install [https://developer.mozilla.org/en-US/docs/Ccache ccache], which can make rebuilding Firefox faster after you have built it once.  (If you don&#039;t install ccache, you must remove the --with-ccache line from the sample mozconfig below.)&lt;br /&gt;
&lt;br /&gt;
  brew install ccache&lt;br /&gt;
&lt;br /&gt;
===== Install Android NDK =====&lt;br /&gt;
&lt;br /&gt;
Download and extract the [http://developer.android.com/sdk/ndk/ Android NDK]. NDK revs 4-8 (except r8d) have been tested and are known to work. The automated builders currently use version r8c. r8d does NOT work (see {{bug|825968}}).&lt;br /&gt;
&lt;br /&gt;
NOTE: there have been reports that r8c does not work on OS X before 10.7.0 (i.e. on Snow Leopard); you may need to try an older NDK version if you are running Snow Leopard. [https://groups.google.com/forum/?fromgroups=#!topic/android-ndk/2L0TyNaiywA link] and [https://groups.google.com/forum/?fromgroups=#!topic/android-ndk/gpo3IHkIKeE link].&lt;br /&gt;
&lt;br /&gt;
 wget http://dl.google.com/android/ndk/android-ndk-r8c-darwin-x86.tar.bz2&lt;br /&gt;
 tar -xjf android-ndk-r8c-darwin-x86.tar.bz2&lt;br /&gt;
&lt;br /&gt;
===== Install Android SDK =====&lt;br /&gt;
&lt;br /&gt;
You should just install the latest [http://developer.android.com/sdk/ Android SDK], we set the API level in our manifest files.  The sdk download will take a while, make sure you have a decent internet connection and go get coffee, or maybe lunch.&lt;br /&gt;
&lt;br /&gt;
You will need SDK version at least 16.&lt;br /&gt;
&lt;br /&gt;
 wget http://dl.google.com/android/android-sdk_r20.0.3-macosx.zip&lt;br /&gt;
 unzip android-sdk_r20.0.3-macosx.zip&lt;br /&gt;
 ./android-sdk-macosx/tools/android update sdk --no-ui&lt;br /&gt;
 ./android-sdk-macosx/tools/android update adb&lt;br /&gt;
&lt;br /&gt;
You will probably want to add the SDK&#039;s &amp;quot;tools&amp;quot; and &amp;quot;platform-tools&amp;quot; directory to the PATH environment variable in your shell, so that you can run [http://developer.android.com/guide/developing/tools/adb.html adb] and other tools easily. For example, if you installed the SDK in $HOME, you could add the following line to the end of your .bashrc:&lt;br /&gt;
&lt;br /&gt;
  export PATH=$PATH:$HOME/android-sdk-macosx/platform-tools:$HOME/android-sdk-macosx/tools&lt;br /&gt;
&lt;br /&gt;
=== Getting the source ===&lt;br /&gt;
&lt;br /&gt;
Once you have build tools set up, you should configure Mercurial as described [https://developer.mozilla.org/en-US/docs/Installing_Mercurial#Configuration here]. (It is not required, but highly recommended if you plan on touching the code in any way). Once you have done that, grab a clone of the repository:&lt;br /&gt;
&lt;br /&gt;
 hg clone http://hg.mozilla.org/mozilla-central/ src&lt;br /&gt;
&lt;br /&gt;
=== Setup Fennec mozconfig ===&lt;br /&gt;
&lt;br /&gt;
The mozconfig file is what tells the mozilla build scripts how your build environment is set up, and sets various build options. To build scripts will read the mozconfig file from the $MOZCONFIG environment variable, if one is set, or the .mozconfig file in your src directory, if there is one. So you could do either this:&lt;br /&gt;
&lt;br /&gt;
 cd src&lt;br /&gt;
 vim .mozconfig # put mozconfig here&lt;br /&gt;
&lt;br /&gt;
or this:&lt;br /&gt;
&lt;br /&gt;
 cd some/random/folder&lt;br /&gt;
 vim my-fennec-mozconfig # put mozconfig here&lt;br /&gt;
 export MOZCONFIG=$PWD/my-fennec-mozconfig&lt;br /&gt;
&lt;br /&gt;
Here is an example mozconfig file for building Fennec, assuming you have followed the instructions above and are using version r8c of the NDK.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # Add the correct paths here:&lt;br /&gt;
 ac_add_options --with-android-ndk=&amp;quot;$HOME/android-ndk-r8c&amp;quot;&lt;br /&gt;
 ac_add_options --with-android-sdk=&amp;quot;$HOME/android-sdk-linux/platforms/android-16&amp;quot;&lt;br /&gt;
 ac_add_options --with-android-version=9&lt;br /&gt;
&lt;br /&gt;
 # android options&lt;br /&gt;
 ac_add_options --enable-application=mobile/android&lt;br /&gt;
 ac_add_options --target=arm-linux-androideabi&lt;br /&gt;
 ac_add_options --with-ccache&lt;br /&gt;
&lt;br /&gt;
 mk_add_options MOZ_OBJDIR=./objdir-droid&lt;br /&gt;
 mk_add_options MOZ_MAKE_FLAGS=&amp;quot;-j9 -s&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remember to use $HOME instead of ~ in the mozconfig, because ~ will not get expanded to the right path! If you are building on Mac OS X you will also need to add this:&lt;br /&gt;
&lt;br /&gt;
 ac_add_options --disable-crashreporter&lt;br /&gt;
&lt;br /&gt;
because the crash reporter does not build properly on Mac OS X.&lt;br /&gt;
&lt;br /&gt;
If you want to build for armv6 add this:&lt;br /&gt;
&lt;br /&gt;
  ac_add_options --with-arch=armv6&lt;br /&gt;
&lt;br /&gt;
You can also look at [http://mxr.mozilla.org/mozilla-central/source/mobile/android/config/mozconfigs/android/nightly the mozconfig used for official nightly builds].&lt;br /&gt;
&lt;br /&gt;
=== Building the code ===&lt;br /&gt;
&lt;br /&gt;
This will build (compile+link), package into apk, and deploy to the Android device. Therefore, before you start building  [http://developer.android.com/guide/developing/device.html connect your Android device and enable USB debugging]&lt;br /&gt;
&lt;br /&gt;
 cd src&lt;br /&gt;
 make -f client.mk build_and_deploy&lt;br /&gt;
&lt;br /&gt;
You can also just do:&lt;br /&gt;
&lt;br /&gt;
 make -f client.mk&lt;br /&gt;
 make -C objdir-droid package&lt;br /&gt;
&lt;br /&gt;
to build and package the code into an APK. The APK file can be found in your objdir-droid/dist/ folder, and will be called something like fennec-18.0a1.en-US.android-arm.apk. You can install this APK to your device manually using &amp;quot;adb install&amp;quot;. The name of the app that shows up on your phone will be &amp;quot;Fennec $USER&amp;quot; (where $USER is the username under which you built the code).&lt;br /&gt;
&lt;br /&gt;
== Hacking ==&lt;br /&gt;
&lt;br /&gt;
There is a bunch of useful information hanging off the page at [[Fennec/NativeUI]]. Below is some more useful information. Please add more stuff you think is useful to these sections!&lt;br /&gt;
&lt;br /&gt;
=== Finding relevant code ===&lt;br /&gt;
&lt;br /&gt;
The Fennec-specific code can be found in the following locations in the mozilla-central source tree:&lt;br /&gt;
&lt;br /&gt;
 mobile/android/...&lt;br /&gt;
 widget/android/...&lt;br /&gt;
&lt;br /&gt;
Of particular interest to most new contributors will be:&lt;br /&gt;
&lt;br /&gt;
 mobile/android/base/GeckoApp.java # the main android activity that starts up when you open Fennec&lt;br /&gt;
 mobile/android/chrome/content/browser.js # the main JS file that controls Gecko to make it do what we want&lt;br /&gt;
&lt;br /&gt;
You can also use the code-search tools at https://mxr.mozilla.org/mozilla-central/ and http://dxr.mozilla.org/ to search for relevant pieces of code.&lt;br /&gt;
&lt;br /&gt;
=== Partial Builds: Beware the startup cache! ===&lt;br /&gt;
&lt;br /&gt;
Developers who frequently update .js files sometimes like to manually only re-build the module they have updated. Partial builds for updated Javascript files may not work correctly if installed with adb install -r. This section describes the issue. For instance:&lt;br /&gt;
&lt;br /&gt;
 make -C mobile/android &amp;amp;&amp;amp; make package&lt;br /&gt;
&lt;br /&gt;
This should result in the APK being properly updated with the updated Javascript, BUT the change may not be reflected on the device because of complications arising from the startup cache. If the startup cache from a previous run of Fennec exists on the device and contains an old version of the recently updated Javascript, Fennec will likely use the old version.&lt;br /&gt;
&lt;br /&gt;
The startup cache is located in the profile, so deleting the profile ensures a new startup cache:&lt;br /&gt;
&lt;br /&gt;
 adb uninstall org.mozilla.fennec&lt;br /&gt;
 adb install dist/fennec*.apk&lt;br /&gt;
&lt;br /&gt;
Note that:&lt;br /&gt;
&lt;br /&gt;
 adb install -r dist/fennec*.apk&lt;br /&gt;
&lt;br /&gt;
retains the profile (and startup cache) -- so that&#039;s still a problem.&lt;br /&gt;
&lt;br /&gt;
None of this is a problem with full builds:&lt;br /&gt;
&lt;br /&gt;
 make -f client.mk &amp;amp;amp;&amp;amp;amp; make package &lt;br /&gt;
 adb install -r dist/fennec*.apk&lt;br /&gt;
&lt;br /&gt;
works just fine, because the startup cache respects the buildid: If the buildid found in an APK is different from the buildid used when the startup cache was last updated, the startup cache is automatically deleted. A full build correctly updates the buildid -- a partial build may not.&lt;br /&gt;
&lt;br /&gt;
A possible way (***I have not conclusively tested this***) to do a partial build, retain an old profile, and ensure the buildid is updated and the startup cache is subsequently deleted is:&lt;br /&gt;
&lt;br /&gt;
 make export &amp;amp;&amp;amp; make -C mobile/android &amp;amp;&amp;amp; make -C toolkit/xre &amp;amp;&amp;amp; make package&lt;br /&gt;
 adb install -r dist/fennec*.apk&lt;br /&gt;
&lt;br /&gt;
Note that make export is necessary to update the buildid and make -C toolkit/xre is required to generate application.ini.h, trigger a rebuild of nsAndroidStartup.cpp, and update libxul.so.&lt;br /&gt;
&lt;br /&gt;
=== Multilocale builds ===&lt;br /&gt;
&lt;br /&gt;
* Create a directory, clone mozharness, copy the config file for easy editing/usage:&lt;br /&gt;
&lt;br /&gt;
 mkdir multilocale&lt;br /&gt;
 cd multilocale&lt;br /&gt;
 hg clone http://hg.mozilla.org/build/mozharness&lt;br /&gt;
 cp mozharness/configs/multi_locale/standalone_mozilla-central.py myconfig.py&lt;br /&gt;
&lt;br /&gt;
* Edit myconfig.py&lt;br /&gt;
** currently will check out m-c into a directory named &#039;mozilla-central&#039; in this directory&lt;br /&gt;
** currently assumes your mozconfig is in this directory and named &#039;mozconfig&#039;&lt;br /&gt;
** currently assumes your mozconfig sets your objdir name to &#039;objdir-droid&#039;&lt;br /&gt;
&lt;br /&gt;
* pull mozilla-central&lt;br /&gt;
&lt;br /&gt;
 mozharness/scripts/multil10n.py --cfg myconfig.py --pull-build-source&lt;br /&gt;
 # Alternately, you can hg clone http://hg.mozilla.org/mozilla-central&lt;br /&gt;
&lt;br /&gt;
* Run the script, which will create a multilocale apk&lt;br /&gt;
&lt;br /&gt;
 mozharness/scripts/multil10n.py --cfg myconfig.py&lt;br /&gt;
&lt;br /&gt;
And you&#039;re done.&lt;br /&gt;
&lt;br /&gt;
* If you want to recompile or re-run the script, restore your objdir to en-US first!&lt;br /&gt;
&lt;br /&gt;
 mozharness/scripts/multil10n.py --cfg myconfig.py --restore-objdir&lt;br /&gt;
&lt;br /&gt;
Also see [http://escapewindow.dreamwidth.org/234671.html this blog post] for more information.&lt;br /&gt;
&lt;br /&gt;
== Testing  ==&lt;br /&gt;
==== Device Managers ====&lt;br /&gt;
Most test suites - mochitests, reftests, xpcshell tests, and others - use a &amp;quot;device manager&amp;quot; module to communicate with the remote device. There are two device manager implementations: ADB and SUT. &lt;br /&gt;
&lt;br /&gt;
The ADB device manager uses the adb command from the Android SDK to communicate with the remote device. To use the ADB device manager:&lt;br /&gt;
* ensure the adb command is in your shell&#039;s PATH&lt;br /&gt;
* set environment variable DM_TRANS=adb&lt;br /&gt;
* do not set environment variable TEST_DEVICE, or set TEST_DEVICE= (unless you really need it)&lt;br /&gt;
&lt;br /&gt;
The SUT device manager uses TCP to communicate with a remote agent, which must be installed on the device. To use the SUT device manager:&lt;br /&gt;
* ensure TCP connectivity between the local host and the remote device: check that they are on the same network and you can ping each from the other&lt;br /&gt;
* ensure the SUT agent is installed and started on the remote device&lt;br /&gt;
** the SUT agent APK is built alongside Fennec; just install &amp;lt;objdir-droid&amp;gt;/build/mobile/sutagent/android/sutAgentAndroid.apk&lt;br /&gt;
** The agent should be configured to start automatically with your phone when it boots. To start it immediately from an adb shell do: `am start -n com.mozilla.SUTAgentAndroid/.SUTAgentAndroid -a android.intent.action.MAIN` &lt;br /&gt;
* set environment variable DM_TRANS=sut&lt;br /&gt;
* set environment variable TEST_DEVICE=&amp;lt;ip address of remote device -- displayed by SUT agent&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: to run the tests you should ensure that your host machine and device are on the same network so that the device can contact the server that will run on the host.&lt;br /&gt;
&lt;br /&gt;
==== Host Builds (MOZ_HOST_BIN) ====&lt;br /&gt;
Android mochitests and reftests require a parallel host build -- a build for the local host (desktop) environment. An environment variable, MOZ_HOST_BIN, must be set to point to that host build. MOZ_HOST_BIN is used to run xpcshell (for instance, to run a simple web server on the desktop), so the MOZ_HOST_BIN directory must contain xpcshell and all the shared libraries required by xpcshell. You can patch together these files from other sources, but the easiest way to get these is to download a xulrunner SDK build from here: http://ftp.mozilla.org/pub/mozilla.org/xulrunner/nightly/latest-trunk/&lt;br /&gt;
&lt;br /&gt;
You can also build desktop Firefox with a mozconfig which might be as simple as:&lt;br /&gt;
&lt;br /&gt;
  ac_add_options --enable-application=browser&lt;br /&gt;
  mk_add_options MOZ_OBJDIR=./objdir-desktop&lt;br /&gt;
&lt;br /&gt;
Then execute:&lt;br /&gt;
&lt;br /&gt;
  export MOZCONFIG=mozconfig.desktop &lt;br /&gt;
  make -f client.mk&lt;br /&gt;
  MOZ_HOST_BIN=objdir-desktop/dist/bin&lt;br /&gt;
  ls -l $MOZ_HOST_BIN/xpcshell&lt;br /&gt;
&lt;br /&gt;
On Linux, the path to that build may also need to be in your LD_LIBRARY_PATH, unless your LD_LIBRARY_PATH contains &amp;quot;.&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
  LD_LIBRARY_PATH=$LD_LIBRARY_PATH:.&lt;br /&gt;
&lt;br /&gt;
==== Test Directory ====&lt;br /&gt;
All Android tests require a remote test directory: A place to store pre-configured profiles, support binaries and libraries, test files, etc. Most tests use a directory in /mnt/sdcard by default; xpcshell and cppunittests use /data/local by default (because it is usually not possible to set execute permission on files on /mnt/sdcard).&lt;br /&gt;
&lt;br /&gt;
The default remote test directory is usually correct and sufficient, but sometimes the default is not appropriate for a device:&lt;br /&gt;
* the device may not contain an SD card, or the SD card may not be mounted&lt;br /&gt;
* there may not be enough free space on the default location&#039;s partition&lt;br /&gt;
* the default location may not be writable by the ADB shell and/or SUT agent&lt;br /&gt;
&lt;br /&gt;
(If you are using a Nexus S, the trick to making your device mountable is to not allow USB Storage between your computer and your device.  When you plug in your device to your computer, simply don&#039;t click the button to allow this on your device and you should be able to run your tests.)&lt;br /&gt;
&lt;br /&gt;
If necessary, the default remote test directory may be changed with:&lt;br /&gt;
&lt;br /&gt;
  export EXTRA_TEST_ARGS=--remoteTestRoot=&amp;lt;remote-directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reftests  ===&lt;br /&gt;
&lt;br /&gt;
  MOZ_HOST_BIN=&amp;quot;&amp;lt;abspath-to-objdir-desktop&amp;gt;/dist/bin/&amp;quot; TEST_PATH=&amp;lt;path&amp;gt; make -C &amp;lt;objdir-droid&amp;gt; reftest-remote&lt;br /&gt;
&lt;br /&gt;
For devices with screens too small you will see the error |can&#039;t drawWindow remote content|. You can ignore that resolution requirement by using the |ignore-window-size| options. NOTE: This may lead to false negative/positives.&lt;br /&gt;
&lt;br /&gt;
  EXTRA_TEST_ARGS=&amp;quot;--ignore-window-size&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Example TEST_PATH:&lt;br /&gt;
&lt;br /&gt;
  TEST_PATH=layout/reftests/reftest-sanity/reftest.list&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
&lt;br /&gt;
* If TEST_PATH is not specified, *all* reftests will be attempted: This usually fails/hangs and is not recommended. Specify a TEST_PATH or use the --total-chunks and --this-chunk arguments to reduce the number of tests executed.&lt;br /&gt;
* sut recommended. Test results displayed and saved to reftest.log and reftest-remote.log.&lt;br /&gt;
* adb works, but reports errors. Test results are not displayed but saved to reftest.log (additional diagnostics in reftest-remote.log).&lt;br /&gt;
* Ensure that the device and host machine are on the same network.&lt;br /&gt;
&lt;br /&gt;
=== Mochitests  ===&lt;br /&gt;
&lt;br /&gt;
  MOZ_HOST_BIN=&amp;quot;&amp;lt;abspath-to-objdir-desktop&amp;gt;/dist/bin/&amp;quot; TEST_PATH=&amp;lt;path&amp;gt; make -C &amp;lt;objdir-droid&amp;gt; mochitest-remote&lt;br /&gt;
&lt;br /&gt;
Note that as of this writing (September 2011) many mochitests will not complete successfully. Try setting your TEST_PATH to &amp;quot;dom/tests/mochitest/dom-level1-core&amp;quot; or &amp;quot;content/smil/test&amp;quot; if you want to restrict yourself to a subset of tests that are known to pass.&lt;br /&gt;
&lt;br /&gt;
TEST_PATH can be:&lt;br /&gt;
 content/smil/test&lt;br /&gt;
 content/xml/document/test&lt;br /&gt;
 content/xslt/tests/mochitest&lt;br /&gt;
 dom/src/json/test&lt;br /&gt;
 dom/src/jsurl/test&lt;br /&gt;
 dom/tests/mochitest/dom-level0&lt;br /&gt;
 dom/tests/mochitest/dom-level1-core&lt;br /&gt;
 dom/tests/mochitest/dom-level2-core&lt;br /&gt;
 dom/tests/mochitest/ajax/mochikit&lt;br /&gt;
 dom/tests/mochitest/ajax/scriptaculous&lt;br /&gt;
 dom/tests/mochitest/ajax/jquery&lt;br /&gt;
 dom/tests/mochitest/dom-level2-html&lt;br /&gt;
 Harness_sanity&lt;br /&gt;
 editor/composer/test&lt;br /&gt;
 intl/uconv/tests&lt;br /&gt;
 dom/tests/mochitest/orientation&lt;br /&gt;
 dom/tests/mochitest/storageevent&lt;br /&gt;
 layout/xul/test&lt;br /&gt;
 modules/libjar/test/mochitest&lt;br /&gt;
 layout/inspector/tests &lt;br /&gt;
 toolkit/xre/test&lt;br /&gt;
 toolkit/components/microformats/tests&lt;br /&gt;
 MochiKit-1.4.2/tests&lt;br /&gt;
 parser/htmlparser/tests/mochitest&lt;br /&gt;
 js&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
* A rooted device is required to run the unit tests using the SUT Agent. Use ADB for unrooted devices (see [[https://wiki.mozilla.org/Mobile/Fennec/Android#Device_Managers]]).&lt;br /&gt;
* Currently using ADB and using /data/local/tests on a non-rooted phone causes setting TEST_PATH to a directory rather than an individual HTML file to fail, and SpecialPowers tests to fail too - filed as {{bug|822652}}&lt;br /&gt;
* Ensure that the device and host machine are on the same network.&lt;br /&gt;
&lt;br /&gt;
=== Robotium ===&lt;br /&gt;
&lt;br /&gt;
The Robotium / Robocop test suite verifies UI behavior in native Fennec. &lt;br /&gt;
&lt;br /&gt;
Build and install native Fennec, then execute the mochitest-robotium make target.&lt;br /&gt;
&lt;br /&gt;
  make -f client.mk build_and_deploy&lt;br /&gt;
  cd &amp;lt;objdir-android&amp;gt;&lt;br /&gt;
  adb install -r dist/robocop.apk&lt;br /&gt;
  MOZ_HOST_BIN=&amp;quot;&amp;lt;abspath-to-objdir-desktop&amp;gt;/dist/bin/&amp;quot; make mochitest-robotium&lt;br /&gt;
&lt;br /&gt;
More info at https://wiki.mozilla.org/Auto-tools/Projects/Robocop.&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
* A rooted device is NOT required.&lt;br /&gt;
* SUT and ADB device managers are both supported.&lt;br /&gt;
* MOZ_HOST_BIN is used to launch xpcshell on the desktop to provide a web server.&lt;br /&gt;
* Use TEST_PATH=&amp;lt;test-name&amp;gt; to run just one test at a time. eg. TEST_PATH=testAwesomebar&lt;br /&gt;
* Ensure that the device and host machine are on the same network.&lt;br /&gt;
** Are the phone and the desktop both using wifi? (wifi vs ethernet??)&lt;br /&gt;
** Are the phone and the desktop both using the same wifi network? (Mozilla vs Mozilla Guest??)&lt;br /&gt;
** Is the desktop environment running in a VM? If so, you likely want a &amp;quot;Bridged&amp;quot; connection -- not NAT or Host-only.&lt;br /&gt;
&lt;br /&gt;
=== xpcshell  ===&lt;br /&gt;
&lt;br /&gt;
Be sure you have successfully built Fennec and generated an APK, as described above.&lt;br /&gt;
&lt;br /&gt;
To run all tests referenced by the master xpcshell manifest:&lt;br /&gt;
&lt;br /&gt;
  cd &amp;lt;objdir-droid&amp;gt;&lt;br /&gt;
  make xpcshell-tests-remote&lt;br /&gt;
&lt;br /&gt;
(Currently the master manifest is quite restricted: only a few tests are run.)&lt;br /&gt;
&lt;br /&gt;
To run a subset of tests in the specified directory:&lt;br /&gt;
&lt;br /&gt;
  make -C &amp;lt;test-directory&amp;gt; xpcshell-tests-remote&lt;br /&gt;
&lt;br /&gt;
Once either of the xpcshell-tests-remote commands has completed successfully, all test files have been copied to device, and it is then possible to run a single test quickly, without setup:&lt;br /&gt;
&lt;br /&gt;
  make SOLO_FILE=&amp;lt;test-file&amp;gt; -C &amp;lt;test-directory&amp;gt; check-one-remote&lt;br /&gt;
&lt;br /&gt;
You can also skip setup for a larger test run (be careful / be sure you know that&#039;s what you want!):&lt;br /&gt;
&lt;br /&gt;
  export EXTRA_TEST_ARGS=&amp;quot;--noSetup&amp;quot;&lt;br /&gt;
  make -C &amp;lt;test-directory&amp;gt; xpcshell-tests-remote&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
* A rooted device IS required.&lt;br /&gt;
* Both ADB and SUT device managers are supported.&lt;br /&gt;
* The test root directory cannot be on /sdcard -- it must be /data/local so that +x permissions can be set on xpcshell.&lt;br /&gt;
* Setup can take several minutes! When using ADB, setup is faster if unzip is available on the remote device; if your device does not have unzip, try installing busybox.&lt;br /&gt;
&lt;br /&gt;
=== cppunittests ===&lt;br /&gt;
&lt;br /&gt;
To run a single compiled code test:&lt;br /&gt;
&lt;br /&gt;
  cd &amp;lt;objdir-droid&amp;gt;&lt;br /&gt;
  export TEST_PATH=&amp;lt;test&amp;gt;&lt;br /&gt;
  make cppunittests-remote&lt;br /&gt;
&lt;br /&gt;
For example, TEST_PATH=xpcom/tests/TestTimers, or TEST_PATH=&amp;quot;xpcom/tests/TestTimers xpcom/tests/TestFile&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
To run all the compiled code tests in a directory:&lt;br /&gt;
&lt;br /&gt;
  cd &amp;lt;objdir-droid&amp;gt;&lt;br /&gt;
  make -C &amp;lt;dir&amp;gt; cppunittests-remote&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
  make -C xpcom/tests cppunittests-remote&lt;br /&gt;
&lt;br /&gt;
Advanced features:&lt;br /&gt;
&lt;br /&gt;
As with xpcshell tests, you can skip setup if needed:&lt;br /&gt;
&lt;br /&gt;
  export EXTRA_TEST_ARGS=&amp;quot;--noSetup&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This will avoid copying any files to the device -- be sure that all necessary files are on the device before using this!&lt;br /&gt;
&lt;br /&gt;
You can change the environment variables seen by the unit test:&lt;br /&gt;
&lt;br /&gt;
  export EXTRA_TEST_ARGS=&amp;quot;--addEnv MYVAR=value&amp;quot;&lt;br /&gt;
  export EXTRA_TEST_ARGS=&amp;quot;--addEnv MYVAR1=value1 --addEnv MYVAR2=value2&amp;quot;&lt;br /&gt;
  export EXTRA_TEST_ARGS=&amp;quot;--addEnv HOME=&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
* Either adb or sut device manager may be used&lt;br /&gt;
* All files are copied to /data/local/tests by default. On some devices, you may need to create /data/local/tests and make it world writable.&lt;br /&gt;
&lt;br /&gt;
=== browser-chrome ===&lt;br /&gt;
&lt;br /&gt;
Before you run tests, you will need to make sure you have packaged the tests in your object dir:&lt;br /&gt;
&lt;br /&gt;
  make -C &amp;lt;objdir-droid&amp;gt; package-tests&lt;br /&gt;
&lt;br /&gt;
There is currently no special make command to build and run browser-chrome tests, but it should be possible to make them run by calling:&lt;br /&gt;
&lt;br /&gt;
  cd &amp;lt;objdir-droid&amp;gt;/_tests/testing/mochitest&lt;br /&gt;
  python runtestsremote.py --dm_trans=adb --test-path=mobile --browser-chrome --deviceIP=1.2.3.4 &lt;br /&gt;
                           --app=org.mozilla.fennec_$USER --xre-path=&amp;lt;objdir_x86&amp;gt;/dist/bin/&lt;br /&gt;
&lt;br /&gt;
=== talos ===&lt;br /&gt;
&lt;br /&gt;
*NOTE: this requires python 2.5 or greater (tested up to 2.7)&lt;br /&gt;
&lt;br /&gt;
See https://wiki.mozilla.org/Buildbot/Talos&lt;br /&gt;
&lt;br /&gt;
This is 100% out of band from mozilla-central (same for desktop also).&lt;br /&gt;
&lt;br /&gt;
  hg clone http://hg.mozilla.org/build/talos talos&lt;br /&gt;
  cd talos&lt;br /&gt;
  python INSTALL.py&lt;br /&gt;
  . bin/activate&lt;br /&gt;
  cd talos&lt;br /&gt;
&lt;br /&gt;
Run these commands to check out the talos dependencies (assuming you are already in the &amp;quot;talos/talos&amp;quot; directory):&lt;br /&gt;
&lt;br /&gt;
  cd page_load_test&lt;br /&gt;
  wget http://people.mozilla.org/~jmaher/mobile_tp4.zip&lt;br /&gt;
  unzip mobile_tp4.zip&lt;br /&gt;
&lt;br /&gt;
Configure a talos profile. You can do this via adb or [http://people.mozilla.com/~bmoss/SUTAgent/ SUTAgent] - if you want to use adb make sure you have rooted your device such that &amp;quot;adb shell&amp;quot; goes directly into a root shell. If you want to use adb to communicate with the device remotely, do something like this:&lt;br /&gt;
&lt;br /&gt;
  talos -v -e org.mozilla.fennec \&lt;br /&gt;
                         --develop \&lt;br /&gt;
                         --activeTests tprovider \&lt;br /&gt;
                         --output trobo.yml \&lt;br /&gt;
                         --remotePort -1 \&lt;br /&gt;
                         --remoteDevice 1.2.3.4 \&lt;br /&gt;
                         [--fennecIDs &amp;lt;abs-path-to-objdir&amp;gt;/dist/fennec_ids.txt]&lt;br /&gt;
&lt;br /&gt;
If you want to use [http://people.mozilla.com/~bmoss/SUTAgent/ SUTAgent] to communicate with the device, do something like this:&lt;br /&gt;
&lt;br /&gt;
  talos -v -e org.mozilla.fennec \&lt;br /&gt;
                         --develop \&lt;br /&gt;
                         --activeTests tsvg \&lt;br /&gt;
                         --results_url file://${PWD}/tsvg.txt \&lt;br /&gt;
                         --noChrome \&lt;br /&gt;
                         --remoteDevice &amp;lt;ip of your sutagent&amp;gt; \&lt;br /&gt;
                         [--fennecIDs &amp;lt;abs-path-to-objdir&amp;gt;/dist/fennec_ids.txt]&lt;br /&gt;
&lt;br /&gt;
SUTAgent will not be able to read the application.ini on the device, so you will need to copy it. We highly recommend pulling the application.ini from the .apk and copying it to the talos/talos/remoteapp.ini file.&lt;br /&gt;
&lt;br /&gt;
For Robocop based tests (tcheck, tcheck2, tcheck3, tprovider, etc...), we need to use the --fennecIDs flag to pass in the generated fennec_ids.txt file from the build you are testing.  This file is generated during build time and has to match the fennec.apk and robocop.apk file.  When this flag is used, we copy fennec_ids.txt and robotium.config (generated during configuration time) to the device and use those to run Robocop.  If you are running ts, tp4, tsvg, or other traditional talos tests, there is no need for the --fennecIDs flag.&lt;br /&gt;
&lt;br /&gt;
Unless two applications are signed with the same key they cannot read each others&#039; /data/data directories, so SUTAgent cannot read org.mozilla.fennec&#039;s data directory.&lt;br /&gt;
You can extract it from the fennec .apk or get it from adb from e.g. /data/data/org.mozilla.fennec/application.ini&lt;br /&gt;
&lt;br /&gt;
  shell@android:/ $ su&lt;br /&gt;
  shell@android:/ # cat /data/data/org.mozilla.fennec/application.ini&lt;br /&gt;
  [App]&lt;br /&gt;
  Vendor=Mozilla&lt;br /&gt;
  Name=Fennec&lt;br /&gt;
  Version=10.0a1&lt;br /&gt;
  BuildID=20111031031100&lt;br /&gt;
  SourceRepository=http://hg.mozilla.org/mozilla-central&lt;br /&gt;
  SourceStamp=04b4ea333800&lt;br /&gt;
  ID={a23983c0-fd0e-11dc-95ff-0800200c9a66}&lt;br /&gt;
  &lt;br /&gt;
  [Gecko]&lt;br /&gt;
  MinVersion=1.9.2b5pre&lt;br /&gt;
  MaxVersion=10.0a1&lt;br /&gt;
  &lt;br /&gt;
  [XRE]&lt;br /&gt;
  EnableExtensionManager=1&lt;br /&gt;
  &lt;br /&gt;
  [Crash Reporter]&lt;br /&gt;
  Enabled=1&lt;br /&gt;
  ServerURL=https://crash-reports.mozilla.com/submit&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: As of this writing (Sept 27, 2011), the tgfx pageset does not currently work (it isn&#039;t run on the desktop either). Don&#039;t try it. :)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: When running robocop-based talos tests (tcheck, etc), be aware that some robocop-required files are not updated by Talos. For example, robocop.apk is not installed. Your best bet is to run mochitest-robotium first to make sure everything is up to date, or manually install robocop.apk from the dist folder.&lt;br /&gt;
&lt;br /&gt;
Aside: For a quick-and-dirty hacky way to run robocop-talos tests locally, see [[Mobile/Fennec/Android/LocalRoboTalos]]&lt;br /&gt;
&lt;br /&gt;
=== S1/S2 Automation ===&lt;br /&gt;
These tests start Fennec with a URL and measure the time to throbber start, time to throbber stop, and drawing end times. &lt;br /&gt;
 &lt;br /&gt;
S1/S2 graphs can be viewed at:  http://mrcote.info/phonedash/#/&lt;br /&gt;
&lt;br /&gt;
Manual run instructions can be found at: https://etherpad.mozilla.org/fennec-perf-ts-take2&lt;br /&gt;
&lt;br /&gt;
See also: https://wiki.mozilla.org/Mobile/Performance/S1S2-Tests&lt;br /&gt;
&lt;br /&gt;
=== Eideticker ===&lt;br /&gt;
Eideticker measures perceived Firefox performance by video capturing automated browser interactions.&lt;br /&gt;
&lt;br /&gt;
Eideticker graphs can be viewed at: http://eideticker.wrla.ch/#/&lt;br /&gt;
&lt;br /&gt;
See also: http://wrla.ch/blog/2011/11/measuring-what-the-user-sees/ and http://wrla.ch/blog/2012/03/announcing-the-eideticker-mobile-performance-dashboard/.&lt;br /&gt;
&lt;br /&gt;
=== Trouble-shooting testing problems ===&lt;br /&gt;
&lt;br /&gt;
* Does your mozconfig contain &amp;quot;ac_add_options --disable-tests&amp;quot;?&lt;br /&gt;
** If so, you will see something like:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
make: *** No rule to make target &amp;lt;your-test-target&amp;gt;.  Stop.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Is adb in your $PATH?&lt;br /&gt;
* Is your device connected? Does it appear in the output from &amp;quot;adb devices&amp;quot;?&lt;br /&gt;
* Can you run adb shell?&lt;br /&gt;
* If running xpcshell, did you create /data/local/tests?&lt;br /&gt;
* If running &amp;quot;make check-one-remote&amp;quot;, did you first setup the device with &amp;quot;make xpcshell-tests-remote&amp;quot;?&lt;br /&gt;
&lt;br /&gt;
== Debugging ==&lt;br /&gt;
&lt;br /&gt;
=== Using logcat ===&lt;br /&gt;
&lt;br /&gt;
[http://developer.android.com/guide/developing/tools/logcat.html logcat] is a tool that is going to show you some logs prompted by the device. It might be a good help if you don&#039;t want to or can&#039;t run gdb. You can use it by running this command: &lt;br /&gt;
&lt;br /&gt;
  adb logcat -v time&lt;br /&gt;
&lt;br /&gt;
You can make things appear in logcat using printf_stderr. With debug builds, NS_WARNING, NS_ERROR and NS_ASSERTIONS will show up in logcat. If you&#039;re trying to debug something, you may wish to pipe the logcat output through grep to filter out irrelevant things (most Fennec-related output will be viewable by &amp;quot;adb logcat | grep Gecko&amp;quot;), but remember that when attaching log output to a bug you should include unfiltered output as there may be relevant log entries under other tags.&lt;br /&gt;
&lt;br /&gt;
==== Using aLogCat ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Note:&amp;lt;/b&amp;gt; aLogCat (and other logcat apps) do not support Jelly Bean (4.1) and above. It seems like the only way to get these apps to work on those versions is to root the device, which, although fulfilling, is probably more work than just using &amp;lt;code&amp;gt;adb logcat&amp;lt;/code&amp;gt;. If you are running Jelly Bean and above, you can instead install the about:logcat add-on at https://people.mozilla.com/~kgupta/aboutlogcat.xpi (works on Firefox 21 and up) to view the logcat.&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t have the Android SDK installed, you can still extract logs using an application called aLogCat. Install it from the Android Market. Use it to capture logs and attach the logs to bugs.&lt;br /&gt;
&lt;br /&gt;
https://market.android.com/details?id=org.jtb.alogcat&amp;amp;hl=en&lt;br /&gt;
&lt;br /&gt;
Once you have alogcat installed, just use Fennec as you would normally. Upon encountering a bug or issue, start the aLogcat app (as soon as possible after seeing the Fennec issue) and select &amp;quot;Share&amp;quot; or &amp;quot;Save&amp;quot; from the menu to send it via email or save it to the SD card. The log can then be attached to a bug or sent to a developer. As with adb logcat, it is better to have a log with timestamps than without timestamps. To enable timestamps in the log, select &amp;quot;Preferences&amp;quot; from the aLogcat menu, and change the &amp;quot;Format?&amp;quot; option to &amp;quot;Time&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If you need to, you can search for some kinds of Fennec-related output by using the &amp;quot;Filter&amp;quot; menu item and entering &amp;quot;Gecko&amp;quot;. However, when submitting logs for bug reports, please make sure you clear the filter and include all of the available log data.&lt;br /&gt;
&lt;br /&gt;
==== JavaScript dump() ====&lt;br /&gt;
&lt;br /&gt;
To use the dump() function in JavaScript to write to the log:&lt;br /&gt;
&lt;br /&gt;
# Go to about:config and set browser.dom.window.dump.enabled to &amp;quot;true&amp;quot;&lt;br /&gt;
# Run the following ADB commands:&lt;br /&gt;
&lt;br /&gt;
 adb shell stop&lt;br /&gt;
 adb shell setprop log.redirect-stdio true&lt;br /&gt;
 adb shell start&lt;br /&gt;
&lt;br /&gt;
=== Using nVidia GDB ===&lt;br /&gt;
&lt;br /&gt;
Nvidia&#039;s gdb is better than most other gdbs: http://developer.download.nvidia.com/tegra/files/tegra-gdb-20100902.zip .&lt;br /&gt;
Even so, you probably want to use JimDB instead of Nvidia&#039;s gdb ...&lt;br /&gt;
&lt;br /&gt;
=== Using JimDB ===&lt;br /&gt;
* jchen has been working on a better Android gdb (&#039;jimdb&#039;). [https://github.com/darchons/android-gdb source], and [[Mobile/Fennec/Android/GDB|build instructions]]. For best results, rebuild everything.&lt;br /&gt;
* [http://www.jnchen.com/_media/projects/mozilla/moz-gdb.tar.bz2 Prebuilt binaries] are available but problems with them have been reported.&lt;br /&gt;
*  [http://people.mozilla.com/~bgirard/moz-gdb-darwin-prebuilt-2012-10.tar.gz October 2012 Darwin prebuilt]&lt;br /&gt;
** The link to the prebuilt binaries seems broken, as of March 30 2012 (bjacob).&lt;br /&gt;
* JimDB:&lt;br /&gt;
** has most fixes from NDK gdb&lt;br /&gt;
** integrates Android libthread_db (fixed dougt&#039;s problem debugging threads)&lt;br /&gt;
** has Python scripting support&lt;br /&gt;
** [https://github.com/darchons/android-gdbutils couple of existing Python scripts] (or if using prebuilt binaries above, just run &#039;git pull&#039; under the &#039;utils&#039; directory)&lt;br /&gt;
*** feninit is a tool to initialize the GDB environment (support for multiple devices, multiple object directories; launches Fennec, pulls libraries, sets paths, and attaches gdbserver automatically)&lt;br /&gt;
*** tracebt is a WIP stack unwinder that traces instructions to find stack frames&lt;br /&gt;
*** idea for another tool to parse and integrate logcat into gdb&lt;br /&gt;
*** other ideas welcome!&lt;br /&gt;
* see [[Mobile/Fennec/Android/GDB]] for installation instructions&lt;br /&gt;
&lt;br /&gt;
Once JimDB is installed, just run its gdb executable. This is will take care of everything (it will start gdbserver on the device, start Fennec, and start gdb on your computer):&lt;br /&gt;
&lt;br /&gt;
  ./moz-gdb/bin/gdb&lt;br /&gt;
&lt;br /&gt;
=== Using Debug Intent ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note: this is not useful with JimDB. If you want to use JimDB, just start it.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to attach before things get running, launch with: &lt;br /&gt;
&lt;br /&gt;
   adb shell am start -a org.mozilla.gecko.DEBUG -n org.mozilla.fennec_foobar/.App&lt;br /&gt;
&lt;br /&gt;
(Replace foobar by your username)&lt;br /&gt;
&lt;br /&gt;
and just click launch once gdb is attached. If you need to debug a crash that happens before XRE_Main is called, the patch on {{bug|572247}} may be useful. &lt;br /&gt;
&lt;br /&gt;
this script [http://dump.lassey.us/debug.sh] will attach gdbserver for you&lt;br /&gt;
&lt;br /&gt;
=== Getting dalvik java stack dumps using gdb ===&lt;br /&gt;
&lt;br /&gt;
(gdb) call handleSigQuit()&lt;br /&gt;
&lt;br /&gt;
this will dump a stack trace to gDvm.stackTraceFile which defaults to &amp;quot;/data/anr/traces.txt&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Note: this will only work if you have symbols for dalvik. (It may be possible to get the address for handleSigQuit by reading&lt;br /&gt;
the symbol table using sigaction.)&lt;br /&gt;
&lt;br /&gt;
Note: deleting /data/anr/traces.txt will cause this method to stop working. You can fix it by recreating the file with $ echo &amp;quot;&amp;quot; &amp;gt; traces.txt&lt;br /&gt;
&lt;br /&gt;
=== Debugging with jdb ===&lt;br /&gt;
&lt;br /&gt;
Inspired by&lt;br /&gt;
http://asantoso.wordpress.com/2009/09/26/using-jdb-with-adb-to-debugging-of-android-app-on-a-real-device/&lt;br /&gt;
&lt;br /&gt;
After staring fennec with jimdb the following seems to work at least a little.&lt;br /&gt;
&lt;br /&gt;
  $ adb jdwp # lists the pids of processes hosting jdwp&lt;br /&gt;
  5543&lt;br /&gt;
  $ adb -d forward tcp:8686 jdwp:5543&lt;br /&gt;
  $ jdb -J-Duser.home=. -connect com.sun.jdi.SocketAttach:hostname=localhost,port=8686  -sourcepath ~/mozilla/maple/mobile/android/base/&lt;br /&gt;
&lt;br /&gt;
You can also use eclipse for debugging in a similar way by setting up for debugging &amp;quot;Remote Java application&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This doesn&#039;t seem to work for me in Ubuntu 12.04 anymore.&lt;br /&gt;
&lt;br /&gt;
=== Debugging with eclipse ===&lt;br /&gt;
&lt;br /&gt;
You need to find the PID of your fennec process. Forward it to a local TCP socket as in &amp;quot;Debugging with jdb.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
In Eclipse switch to the debug perspective. Go to Run &amp;gt; Debug configurations... Remote Java Application. Change the port to the TCP port you specified in your adb command. Under Source, navigate to your checkout, then into mobile/android.&lt;br /&gt;
&lt;br /&gt;
Eclipse looks for source code in a specific location. You need to create the directory hierarchy:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 mobile&lt;br /&gt;
  /android&lt;br /&gt;
    /org&lt;br /&gt;
      mozilla/&lt;br /&gt;
        gecko -&amp;gt; ../../base&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That is, in mozilla-central/mobile/android, create org/mozilla, and put the symlink gecko pointing to mozilla-central/mobile/android/base.&lt;br /&gt;
&lt;br /&gt;
You may also want to add more debugging information and can do that like this:&lt;br /&gt;
 diff --git a/config/android-common.mk b/config/android-common.mk&lt;br /&gt;
 index 4591239..a47726a 100644&lt;br /&gt;
 --- a/config/android-common.mk&lt;br /&gt;
 +++ b/config/android-common.mk&lt;br /&gt;
 @@ -70,6 +70,6 @@ JAVAC_FLAGS = \&lt;br /&gt;
    -classpath $(JAVA_CLASSPATH) \&lt;br /&gt;
    -bootclasspath $(JAVA_BOOTCLASSPATH) \&lt;br /&gt;
    -encoding UTF8 \&lt;br /&gt;
 -  -g:source,lines \&lt;br /&gt;
 +  -g:source,lines,vars \&lt;br /&gt;
    -Werror \&lt;br /&gt;
    $(NULL)&lt;br /&gt;
&lt;br /&gt;
=== Arguments and Environment Variables ===&lt;br /&gt;
&lt;br /&gt;
If you need to set an environment variable at run time, append &#039;&#039;&#039;--es env# VAR=VAL&#039;&#039;&#039; to your activity manager command where # is the ordered number of variables for example: &lt;br /&gt;
&lt;br /&gt;
  adb shell am start -a android.activity.MAIN -n org.mozilla.fennec_$USER/.App --es env0 VAR=val --es env1 FOO=bar&lt;br /&gt;
&lt;br /&gt;
If you need to pass arguments at run time, append &#039;&#039;&#039;--es args &amp;quot;&amp;lt;your-args&amp;gt;&amp;quot;&#039;&#039;&#039; to your activity manager command. For example, to launch with a specific profile: &lt;br /&gt;
&lt;br /&gt;
  adb shell am start -a android.activity.MAIN -n org.mozilla.fennec_$USER/.App --es args &amp;quot;--profile /mnt/sdcard/myprofile&amp;quot;&lt;br /&gt;
&lt;br /&gt;
To launch with a specific URL, use the am -d option to set the intent&#039;s data URI:&lt;br /&gt;
&lt;br /&gt;
  adb shell am start -a android.activity.MAIN -n org.mozilla.fennec_$USER/.App -d &#039;http://www.mozilla.org&#039;&lt;br /&gt;
&lt;br /&gt;
=== PR Logging ===&lt;br /&gt;
&lt;br /&gt;
You can use the env vars as described above to enable NSPR logging:&lt;br /&gt;
&lt;br /&gt;
  adb shell am start -a android.activity.MAIN -n org.mozilla.fennec_$USER/.App --es env0 NSPR_LOG_MODULES=all:5 --es env1 NSPR_LOG_FILE=/mnt/sdcard/log.txt&lt;br /&gt;
&lt;br /&gt;
If no file is specified, logging is directed to the android logs: &lt;br /&gt;
&lt;br /&gt;
  adb shell am start -a android.activity.MAIN -n org.mozilla.fennec_$USER/.App --es env0 NSPR_LOG_MODULES=all:5&lt;br /&gt;
&lt;br /&gt;
Look for lines marked &amp;quot;PRLog&amp;quot; in the adb logcat output.&lt;br /&gt;
&lt;br /&gt;
=== debugging without rooting  ===&lt;br /&gt;
&lt;br /&gt;
with Froyo you can debug without rooting your phone. Instructions are below. See also [[Mobile/Fennec/Android/GDBNoRoot|Fennec/Android/GDBNoRoot]] for another guide on how to do this.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
First thing, to make this work with the nvidia gdb (which I found more reliable than the android r3 gdb) you need to modify install.sh and debug.sh. &lt;br /&gt;
&lt;br /&gt;
first, change the location where install.sh copies gdbserver to somewhere writable by a non-root process. I used /data/local. Be sure to update that both in the push command and the chmod command. &lt;br /&gt;
&lt;br /&gt;
second, update debug.sh with the new location of gdbserver. &lt;br /&gt;
&lt;br /&gt;
finally, you&#039;ll need to add run-as $2 to the adb shell command that launches gdbserver. In the end you should have: install.sh: &lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 mkdir lib&lt;br /&gt;
 adb push prebuilt/gdbserver /data/local&lt;br /&gt;
 adb shell chmod 755 /data/local/gdbserver&lt;br /&gt;
 for file in $(adb shell ls /system/lib | tr &amp;quot;\n&amp;quot; &amp;quot; &amp;quot; | tr &amp;quot;\r&amp;quot; &amp;quot; &amp;quot;); do&lt;br /&gt;
   adb pull /system/lib/$file lib&lt;br /&gt;
 done&lt;br /&gt;
 adb pull /system/bin/app_process lib &lt;br /&gt;
&lt;br /&gt;
The above will miss some vendor drivers, you can use busybox to find all shared libraries&lt;br /&gt;
&lt;br /&gt;
 for file in $(adb shell /data/local/busybox find / -name &amp;quot;*.so&amp;quot; | tr &amp;quot;\n&amp;quot; &amp;quot; &amp;quot; | tr &amp;quot;\r&amp;quot; &amp;quot; &amp;quot;); do  adb pull /$file lib_unlock_nexus/; done&lt;br /&gt;
&lt;br /&gt;
debug.sh: &lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 if [ $# -ne 2 ]&lt;br /&gt;
 then&lt;br /&gt;
   echo &amp;quot;usage: $0 /path/to/your/library.so packagename.of.your.activity&amp;quot;&lt;br /&gt;
   echo &amp;quot;for example:&amp;quot;&lt;br /&gt;
   echo &amp;quot;  $0 /code/mydemo/libs/armeabi/libmydemo.so com.nvidia.devtech.mydemo&amp;quot;&lt;br /&gt;
   exit&lt;br /&gt;
 fi&lt;br /&gt;
 &lt;br /&gt;
 if [&amp;amp;nbsp;! -f $1 ]&lt;br /&gt;
 then&lt;br /&gt;
   echo &amp;quot;ERROR: That library file doesn&#039;t exist&amp;quot;&lt;br /&gt;
   exit&lt;br /&gt;
 fi&lt;br /&gt;
 &lt;br /&gt;
 cp $1 lib&lt;br /&gt;
 &lt;br /&gt;
 p=`adb shell ps | grep $2 | awk &#039;{print $2}&#039;`&lt;br /&gt;
 if [ &amp;quot;$p&amp;quot; = &amp;quot;&amp;quot; ];&lt;br /&gt;
 then&lt;br /&gt;
   echo &amp;quot;ERROR: That doesn&#039;t seem to be a running process. Please make sure your&amp;quot;&lt;br /&gt;
   echo &amp;quot;application has been started and that you are using the correct&amp;quot;&lt;br /&gt;
   echo &amp;quot;namespace argument.&amp;quot;&lt;br /&gt;
   exit&lt;br /&gt;
 fi&lt;br /&gt;
 &lt;br /&gt;
 adb forward tcp:12345 tcp:12345&lt;br /&gt;
 adb shell run-as $2 /data/local/gdbserver --attach&amp;amp;nbsp;:12345 $p&lt;br /&gt;
&lt;br /&gt;
=== Attaching GDB ===&lt;br /&gt;
Assuming you have the nvidia gdb at the top of your home directory and the app_process binary in the current working directory.&lt;br /&gt;
  ~/nvidia-gdb/prebuilt/linux-x86/arm-eabi-gdb ./app_process&lt;br /&gt;
&lt;br /&gt;
=== Reading back the framebuffer ===&lt;br /&gt;
If you need to verify what is in the back buffer at a particular time, you can cleverly call functions from gdb to allocate memory, read back, and write that to disk.&lt;br /&gt;
&lt;br /&gt;
You need to know the size of your framebuffer a priori; in this case, it&#039;s 480x699.&lt;br /&gt;
&lt;br /&gt;
You also need to know what the GL enum values are, because unless you compile with -ggdb, you don&#039;t have #defines available to you in the debugger. Very helpful information: GL_RGBA = 0x1908, GL_UNSIGNED_BYTE = 0x1401. The rest you can find in gfx/gl/GLDefs.h.&lt;br /&gt;
&lt;br /&gt;
You &#039;&#039;&#039;should&#039;&#039;&#039; be able to call glReadPixels directly, but in my experience that causes Fennec to crash. However, if you have a GLContext* lying around, as you often do, you can work around that problem.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;(gdb) set $m = (int*)malloc(480*699*4)&lt;br /&gt;
(gdb) call aManager-&amp;gt;mGLContext.mRawPtr-&amp;gt;fReadPixels(0, 0, 480, 699, 0x1908, 0x1401, (void*)$m)&lt;br /&gt;
(gdb) set $f = fopen(&amp;quot;/sdcard/outputfile&amp;quot;, &amp;quot;wb+&amp;quot;)&lt;br /&gt;
(gdb) call fwrite($m, 1, 480*699*4, $f)&lt;br /&gt;
$7 = 1342080&lt;br /&gt;
(gdb) call fclose($f)&lt;br /&gt;
$8 = 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now there is a file called /sdcard/outputfile that you can adb pull. But since it&#039;s just raw RGBA values, you need to be able to wrap that in PNG headers to display it. [https://github.com/jrmuizel/minpng/blob/master/minpng.h Jeff Muizelaar wrote a header called minpng.h that you can use to do so.]&lt;br /&gt;
&lt;br /&gt;
Get Jeff&#039;s minpng.h, and put it in a directory along with a driver c program:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;#include &amp;quot;minpng.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char* argv[])&lt;br /&gt;
{&lt;br /&gt;
	FILE* f = fopen(argv[1], &amp;quot;rb&amp;quot;);&lt;br /&gt;
	int w = atoi(argv[2]);&lt;br /&gt;
	int h = atoi(argv[3]);&lt;br /&gt;
	char* d = (char*) malloc(w * h * 4);&lt;br /&gt;
	fread(d, w * h * 4, 1, f);&lt;br /&gt;
	fclose(f);&lt;br /&gt;
	write_png(argv[4], d, w, h);&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compile and run:&lt;br /&gt;
&amp;lt;pre&amp;gt;$ gcc -o minpng minpng.c&lt;br /&gt;
$ ./minpng outputfile 480 699 output.png&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Using Rendertrace (Maple) ===&lt;br /&gt;
&lt;br /&gt;
Rendertrace is a utility that will dump layer position and timing information (such as drawing, upload) to the console. This information can pasted into the rendertrace web front end to visualize the layer position and event timeline. This will let you understand where you&#039;re gecko is spending its time and why were checkerboarding.&lt;br /&gt;
&lt;br /&gt;
To enable go in &#039;gfx/layers/RenderTrace.h&#039; and uncomment &#039;#define MOZ_RENDERTRACE&#039;. Rebuild and run &#039;adb logcat | grep RENDERTRACE&#039;, paste the result in http://people.mozilla.org/~bgirard/rendertrace.html and hit &#039;reload&#039;. For details talk to BenWa.&lt;br /&gt;
&lt;br /&gt;
=== Using apitrace ===&lt;br /&gt;
&lt;br /&gt;
Apitrace is a tool for tracing GL/EGL calls for debugging purposes. It basically uses an interim shared library called libapitrace that contains shadow gl* and egl* functions, which then get logged and then passed through to the real driver.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Use apitrace from https://github.com/apitrace/apitrace to build for desktop and android.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt-get install libegl1-mesa-dev libgles1-mesa-dev libgles2-mesa-dev libqt4-dev cmake&lt;br /&gt;
git clone https://github.com/gw280/apitrace.git&lt;br /&gt;
cd apitrace&lt;br /&gt;
&lt;br /&gt;
# Build for Android&lt;br /&gt;
export ANDROID_NDK=/path/to/your/ndk&lt;br /&gt;
cmake -DCMAKE_TOOLCHAIN_FILE=android/android.toolchain.cmake -DANDROID_API_LEVEL=9 -Bbuild-android -H.&lt;br /&gt;
make -C build-android -j8&lt;br /&gt;
&lt;br /&gt;
# Build for desktop&lt;br /&gt;
cmake -H. -Bbuild&lt;br /&gt;
make -C build -j8&lt;br /&gt;
&lt;br /&gt;
export EGL_SOFTWARE=true&lt;br /&gt;
./build/eglretrace -v /path/to/your/apitrace_log.trace&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Android build will create egltrace.so in build-android/wrappers, which you can then push to your device to /data/local:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
adb push build-android/wrappers/egltrace.so /data/local&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restarting Fennec will cause it to load the apitrace library and the apitrace log will be saved to /data/data/org.mozilla.fennec_username/firefox.trace&lt;br /&gt;
&lt;br /&gt;
You can then adb pull /data/data/org.mozilla.fennec_username/firefox.trace and analyse it on your desktop.&lt;br /&gt;
&lt;br /&gt;
You can also use qapitrace as a GUI to inspect your trace files. (be sure to switch qapitrace to the EGL api using the options dialog)&lt;br /&gt;
&lt;br /&gt;
These instructions provide a trace that does not include the Java GL code. To get traces including java code is more complicated. You need to use&lt;br /&gt;
the patch from this bug https://bugzilla.mozilla.org/show_bug.cgi?id=749859 and this version of https://github.com/ideak/apitrace/tree/dev. Further, you&#039;ll need to build your own image/modify the current one to replace /init.rc. You also need to disable hardware acceleration of the UI (https://bug746703.bugzilla.mozilla.org/attachment.cgi?id=619009) Ask jrmuizel for more information if you want to do this.&lt;br /&gt;
&lt;br /&gt;
=== about:memory ===&lt;br /&gt;
about:memory provides heaps (ha!) of useful memory information. &lt;br /&gt;
&lt;br /&gt;
You can obtain a snapshot of memory info from a running Fennec instance using:&lt;br /&gt;
&lt;br /&gt;
  adb shell am broadcast -a org.mozilla.gecko.MEMORY_DUMP&lt;br /&gt;
&lt;br /&gt;
This dumps a json file to /data/data/org.mozilla.fennec_&amp;lt;user&amp;gt;/app_tmp. You can pull the json file to desktop using&lt;br /&gt;
&lt;br /&gt;
  adb pull &amp;lt;absolute-path-to-file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and view it in firefox&#039;s about:memory: use the &amp;quot;Read reports from a file&amp;quot; option at the bottom of the about:memory page.&lt;br /&gt;
&lt;br /&gt;
=== Profiling ===&lt;br /&gt;
&lt;br /&gt;
See https://wiki.mozilla.org/Mobile/Fennec/Android/Profiling.&lt;br /&gt;
&lt;br /&gt;
=== Debugging Java code with DDMS ===&lt;br /&gt;
&lt;br /&gt;
See http://developer.android.com/tools/debugging/ddms.html&lt;br /&gt;
&lt;br /&gt;
== Other useful tips and tricks  ==&lt;br /&gt;
&lt;br /&gt;
=== Tweaking UI prefs ===&lt;br /&gt;
By default, all of these prefs are set to &amp;quot;-1&amp;quot; in Fennec, meaning they take the values listed below, which are maintained in Axis.java.&lt;br /&gt;
&lt;br /&gt;
Fractional values are specified in 1/1000th of a value; to specify a value of 0.3, write 300.&lt;br /&gt;
&lt;br /&gt;
Note: You need to restart Fennec after changing these values.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! Pref !! Default value !! Description !!&lt;br /&gt;
|-&lt;br /&gt;
| ui.scrolling.friction_slow || 850 || This fraction in 1000ths of velocity remains after every animation frame when the velocity is low.||&lt;br /&gt;
|-&lt;br /&gt;
| ui.scrolling.friction_fast || 970 || This fraction in 1000ths of velocity remains after every animation frame when the velocity is high.||&lt;br /&gt;
|-&lt;br /&gt;
| ui.scrolling.velocity_threshold || 10 || Below this velocity (in pixels per frame), the friction changes from friction_fast to friction_slow.||&lt;br /&gt;
|-&lt;br /&gt;
| ui.scrolling.max_event_acceleration || 12 || The maximum velocity change factor between events, per ms, in 1000ths. ||&lt;br /&gt;
|-&lt;br /&gt;
| ui.scrolling.overscroll_decel_rate || 40 || The rate of deceleration when the surface has overscrolled, in 1000ths. ||&lt;br /&gt;
|-&lt;br /&gt;
| ui.scrolling.overscroll_snap_limit || 300 || The fraction of the surface which can be overscrolled before it must snap back, in 1000ths. ||&lt;br /&gt;
|-&lt;br /&gt;
| ui.scrolling.min_scrollable_distance || 500 || The minimum amount of space that must be present for an axis to be considered scrollable, in 1/1000ths of pixels. ||&lt;br /&gt;
|-&lt;br /&gt;
| gfx.displayport.strategy || 1 || The strategy we use to determine how display ports are calculated. 0 = fixed margin, 1 = velocity bias, 2 = dynamic resolution, 3 = no margins ||&lt;br /&gt;
|-&lt;br /&gt;
| gfx.displayport.strategy_fm.multiplier || 1500 || When gfx.displayport.strategy = 0 (fixed margin), the 1000th of each dimension of the viewport the displayport is sized to. ||&lt;br /&gt;
|-&lt;br /&gt;
| gfx.displayport.strategy_fm.danger_x || 100 || When gfx.displayport.strategy = 0 (fixed margin), the 1000th of the width of the viewport the horizontal danger zone is set to.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Danger zone is defined as the space at the edge of the viewport at which the viewport (and hence displayport) starts being changed.&lt;br /&gt;
|-&lt;br /&gt;
| gfx.displayport.strategy_fm.danger_y || 200 || When gfx.displayport.strategy = 0 (fixed margin), the 1000th of the height of the viewport the vertical danger zone is set to. ||&lt;br /&gt;
|-&lt;br /&gt;
| gfx.displayport.strategy_vb.multiplier || 1500 || When gfx.displayport.strategy = 1 (velocity bias), the 1000th of each dimension of the viewport the displayport is sized to. ||&lt;br /&gt;
|-&lt;br /&gt;
| gfx.displayport.strategy_vb.threshold || 32 || When gfx.displayport.strategy = 1 (velocity bias), the threshold for velocity, in pixels/frame, when multiplied by the screen DPI. ||&lt;br /&gt;
|-&lt;br /&gt;
| gfx.displayport.strategy_vb.reverse_buffer || 200 || When gfx.displayport.strategy = 1 (velocity bias), the fraction of the buffer (in 1000ths) to be kept in the direction opposite the direction of the scroll. ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Refresh the JS cache ===&lt;br /&gt;
&lt;br /&gt;
XUL and JavaScript files (like browser.js) are cached for fast startup.  If you change one of these files in your development build, the new file might not be picked up unless you also touch &amp;lt;code&amp;gt;toolkit/xre/nsAndroidStartup.cpp&amp;lt;/code&amp;gt; and rebuild libxul.  (See {{bug|695145}} for details.)&lt;br /&gt;
&lt;br /&gt;
=== killer script ===&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 if [ $# -ne 1 ]&lt;br /&gt;
 then&lt;br /&gt;
     echo &amp;quot;usage: $0  packagename.of.your.activity&amp;quot;&lt;br /&gt;
     echo &amp;quot;for example:&amp;quot;&lt;br /&gt;
     echo &amp;quot;  $0 org.mozilla.fennec&amp;quot;&lt;br /&gt;
     exit&lt;br /&gt;
 fi&lt;br /&gt;
 &lt;br /&gt;
 p=`adb shell ps | grep $1 | awk &#039;{print $2}&#039;`&lt;br /&gt;
 if [ &amp;quot;$p&amp;quot; = &amp;quot;&amp;quot; ];&lt;br /&gt;
 then&lt;br /&gt;
     echo &amp;quot;ERROR: That doesn&#039;t seem to be a running process. Please make sure your&amp;quot;&lt;br /&gt;
     echo &amp;quot;application has been started and that you are using the correct&amp;quot;&lt;br /&gt;
     echo &amp;quot;namespace argument.&amp;quot;&lt;br /&gt;
     exit&lt;br /&gt;
 fi&lt;br /&gt;
 &lt;br /&gt;
 adb shell run-as $1 kill $p&lt;br /&gt;
&lt;br /&gt;
=== .gdbinit ===&lt;br /&gt;
&lt;br /&gt;
This is an example .gdbinit that uses the symbols from a locally built rom and automatically attaches to gdbserver. Note that putting a &#039;&#039;.gdbinit&#039;&#039; file inside a directory will make gdb load it thus you will not pollute your regular gdb init with those configurations. &lt;br /&gt;
&lt;br /&gt;
 set solib-search-path /home/blassey/android/system/out/target/product/passion/symbols/system/bin:/home/blassey/android/system/out/target/product/passion/symbols/system/lib/:/home/blassey/src/ndk5-m-c/objdir-droid-dbg/dist/bin&lt;br /&gt;
 set solib-absolute-prefix /home/blassey/android/system/out/target/product/passion/symbols/system/lib/&lt;br /&gt;
 target remote localhost:12345&lt;br /&gt;
&lt;br /&gt;
=== Connecting Eclipse to Android Build tree ===&lt;br /&gt;
&lt;br /&gt;
Clone scripts and templates:&lt;br /&gt;
  hg clone http://hg.mozilla.org/users/romaxa_gmail.com/eclipse_mobile&lt;br /&gt;
  cd eclipse_mobile&lt;br /&gt;
&lt;br /&gt;
Modify mozconfig_values file, according to your build environment&lt;br /&gt;
add absolute path to obj-build-dir and source dir, Ex:&lt;br /&gt;
  MOZOBJDIR=/home/romaxa/mozdev/mozillahg/mozilla-birch/objdir-droid&lt;br /&gt;
  MOZSRCDIR=/home/romaxa/mozdev/mozillahg/mozilla-birch&lt;br /&gt;
&lt;br /&gt;
Generate project content (build tree must be fully compiled and make -C objdir package commands performed):&lt;br /&gt;
  ./create_projects.pl&lt;br /&gt;
eclipse project will be created in current folder&lt;br /&gt;
&lt;br /&gt;
Create new project in Eclipse&lt;br /&gt;
* File-&amp;gt;New-&amp;gt;Project&lt;br /&gt;
* Android Project&lt;br /&gt;
* Next, Create project from existing source&lt;br /&gt;
* Select current folder as Location, Next&lt;br /&gt;
* Select Build Target &amp;quot;Android 4.1 / API 16&amp;quot;&lt;br /&gt;
* Next and Finish&lt;br /&gt;
&lt;br /&gt;
Press Run App button in order to perform first build,&lt;br /&gt;
On first run, some ADT plugin fnctionality removing bin/App.apk and resource.ap_)&lt;br /&gt;
Don&#039;t know how to teach eclipse don&#039;t do that, but it breaks installable package.&lt;br /&gt;
So in order to fix that problem&lt;br /&gt;
after first Run App, execute in project folder&lt;br /&gt;
  ./fixup_links.pl&lt;br /&gt;
It will update *.apk and *.ap_ symlinks&lt;br /&gt;
&lt;br /&gt;
Press Run App button again&lt;br /&gt;
&lt;br /&gt;
Try to setup breakpoint in onCreate() and press Debug App button.&lt;br /&gt;
&lt;br /&gt;
=== Rooting Android devices ===&lt;br /&gt;
&lt;br /&gt;
See [[Mobile/Fennec/Android/Rooting|Rooting Android Devices]].&lt;br /&gt;
&lt;br /&gt;
=== Bootstrapper.xpi: Testing JS chrome code changes without rebuilding ===&lt;br /&gt;
&lt;br /&gt;
Avoid those nasty compile times! Use the [https://groups.google.com/forum/?fromgroups=#!topic/mozilla.dev.platforms.mobile/jmxkOBREcO0 Bootstrapper extension]!&lt;/div&gt;</summary>
		<author><name>Wchen</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Engagement/Peace_Love_and_Firefox&amp;diff=322711</id>
		<title>Engagement/Peace Love and Firefox</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Engagement/Peace_Love_and_Firefox&amp;diff=322711"/>
		<updated>2011-06-25T09:25:01Z</updated>

		<summary type="html">&lt;p&gt;Wchen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Peace, Love, and Firefox event will take place in San Francisco on June 25, 2011 during the city&#039;s Pride Celebration. The Engagement team has rented an ice cream truck for the event, and it will be parked around Dolores Park from 11:30 am to 3 pm. We&#039;ll be at the park talking with people as we give out free ice cream and swag. This is a great opportunity for Mozillians to interact with our users and spread Firefox. Please sign-up to volunteer for this event. We look forward to having as many of you out there!! &lt;br /&gt;
&lt;br /&gt;
Location: Dolores Park, 20th street between Church St. and Dolores St. &lt;br /&gt;
&lt;br /&gt;
Twitter: @MozMobile &lt;br /&gt;
&lt;br /&gt;
Invite your friends: http://www.facebook.com/event.php?eid=133893816691038&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== Activities  ==&lt;br /&gt;
&lt;br /&gt;
*Ice Cream Truck: &lt;br /&gt;
**Free ice cream from 11:30-3pm &lt;br /&gt;
**Prize Wheel&lt;br /&gt;
&lt;br /&gt;
*DJ: Raymond has volunteered to DJ! &lt;br /&gt;
** Gil Scott-Heron and Jamie XX - NY is killing me&lt;br /&gt;
**Black Business by Poor Righteous Teachers&lt;br /&gt;
**I Changed My Mind (Stereo MCs Rattlesnake Remix) by Lyrics Born&lt;br /&gt;
**S&amp;amp;amp;M - Rihanna &lt;br /&gt;
**Bad Romance/ Born this way - Lady Gaga (Special Live Performance to Bad Romance coordinated by Laura F)&amp;lt;br&amp;gt; &lt;br /&gt;
**I Just Can&#039;t Get Enough (Please make sure DJ gets this song. By Depech Mode ~ Special Live Performance coordinated by Laura F) &lt;br /&gt;
**I don&#039;t feel like dancing- Scissor Sisters &lt;br /&gt;
**Ani DiFranco (I&#039;m not kidding. It will be all chicks) &lt;br /&gt;
**Till the World Ends- Britney Spears &lt;br /&gt;
**Vogue- Madonna &lt;br /&gt;
**On the floor- Jennifer Lopez &lt;br /&gt;
**Onto the next one - Jay-Z &lt;br /&gt;
**Hung up - Madonna &lt;br /&gt;
**Music sounds better with you - Stardust &lt;br /&gt;
**Barbara Streisand - DuckSauce &lt;br /&gt;
**I believe in you - Kylie M &lt;br /&gt;
**Drunk girls - LCD Soundsystem &lt;br /&gt;
***Totally Recommend this List of Music Below (Also contact LOLjon to hear this playlist for a test): &lt;br /&gt;
**Cthulhu Sleeps - Deadmau5 (This will get everyone in the mood)&lt;br /&gt;
**Animal Rights - Deadmau5 (very good dance beats)&lt;br /&gt;
**Civilization - Justice (Thumbs Up for this one!)&lt;br /&gt;
**Pon de Floor - Major Lazer (Really big dance house song)&lt;br /&gt;
**Til Death (R3hab Remix) - Wynter Gordon (This one&#039;s a cool party music)&lt;br /&gt;
**Hey Baby - Mellefresh vs Deadmau5 [please listen to the music before using&amp;amp;nbsp;:)] &lt;br /&gt;
**Raining - Kaskade &amp;amp; Adam K&lt;br /&gt;
**Infinity Guitars - Sleigh Bells (electro alternative)&lt;br /&gt;
**Rawnald Gregory Erickson the Second - Starf****r (yes, that&#039;s their band name) (Totally SF tunes)&lt;br /&gt;
**Bury Us Alive - Starf****r (fresh song of the moment by VMAN Magazine )&lt;br /&gt;
**Hello - Martin Solveig &amp;amp; Dragonette&lt;br /&gt;
**Milkshake - Kelis&lt;br /&gt;
**Sunday Morning - Maroon 5 (Word of Thought: People @ SF like Maroon 5)&lt;br /&gt;
**Kick, Push - Lupe Fiasco&lt;br /&gt;
**XXXO - MIA&lt;br /&gt;
**E-Pro - Beck&lt;br /&gt;
**Roman - Housse de Racket(Really Fresh from Maison Kitsune Record Label!) &lt;br /&gt;
**Sunshine Eyes  - PolarSets(UK Fresh from Maison Kitsune Record Label)&lt;br /&gt;
**Miami to Ibiza - Swedish House Mafia (Really Fresh sounding)&lt;br /&gt;
**Save the World - Swedish House Mafia&lt;br /&gt;
**MGMT - Electric Feel (Justice Remix)&lt;br /&gt;
**Baba O&#039;Reilly - The Who&lt;br /&gt;
**Army of Me - Bjork (Really Cool)&lt;br /&gt;
**Snow &amp;amp; Taxis - Gold Panda (Nice beats!)&lt;br /&gt;
**I also got Lady GaGa, but I dunno what you&#039;ll like from her latest album&lt;br /&gt;
** Be the One - Moby&lt;br /&gt;
** Look at me now - Chris Brown, Busta Rhymes, &amp;amp; Lil Wayne (Chris Brown and Lil Wayne whatever, but you know Busta kills it)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
**Feel free to add songs you would like to hear!&lt;br /&gt;
&lt;br /&gt;
== Signups  ==&lt;br /&gt;
&lt;br /&gt;
Saturday June 25th: &lt;br /&gt;
Important sites to look at before volunteering at this event:&lt;br /&gt;
http://www.mozilla.com/en-US/press/ataglance&lt;br /&gt;
https://wiki.mozilla.org/Brand/Firefox&lt;br /&gt;
&lt;br /&gt;
*11:00 AM - 12:00 PM &lt;br /&gt;
**Wilson &lt;br /&gt;
**ShawnG &lt;br /&gt;
**Diane &lt;br /&gt;
**Atul &lt;br /&gt;
**mrz &lt;br /&gt;
**Grace &lt;br /&gt;
**Winston &lt;br /&gt;
**Stas &lt;br /&gt;
**Eljon &lt;br /&gt;
**Nikhil &lt;br /&gt;
**Diyang &lt;br /&gt;
**Jen &lt;br /&gt;
**Chrissie &lt;br /&gt;
**WilliamR &lt;br /&gt;
**name &lt;br /&gt;
**__ &lt;br /&gt;
**__ &lt;br /&gt;
**__ &lt;br /&gt;
**We need as many of you at this event&lt;br /&gt;
&lt;br /&gt;
*12:00 PM - 1:00 PM &lt;br /&gt;
**Wilson &lt;br /&gt;
**AndyS &lt;br /&gt;
**WilliamR &lt;br /&gt;
**mrz &lt;br /&gt;
**Arzhel &lt;br /&gt;
**Jérémy &lt;br /&gt;
**Grace &lt;br /&gt;
**Winston &lt;br /&gt;
**Stas &lt;br /&gt;
**Eljon &lt;br /&gt;
**Nikhil &lt;br /&gt;
**Diyang &lt;br /&gt;
**rpearl &lt;br /&gt;
**Abhinav&lt;br /&gt;
**Nick&lt;br /&gt;
**__ &lt;br /&gt;
**We need as many of you at this event&lt;br /&gt;
&lt;br /&gt;
*1:00 PM - 2:00 PM &lt;br /&gt;
**Wilson &lt;br /&gt;
**mrz &lt;br /&gt;
**WilliamR&amp;lt;br&amp;gt; &lt;br /&gt;
**Chrissie &lt;br /&gt;
**Abhinav &lt;br /&gt;
**fligtar&lt;br /&gt;
**ShaneT&lt;br /&gt;
**__ &lt;br /&gt;
**We need as many of you at this event&lt;br /&gt;
&lt;br /&gt;
*2:00 PM - 3:00 PM &lt;br /&gt;
**Wilson &lt;br /&gt;
**WilliamR&amp;lt;br&amp;gt; &lt;br /&gt;
**Chrissie &lt;br /&gt;
**mrz &lt;br /&gt;
**fligtar&lt;br /&gt;
**ShaneT&lt;br /&gt;
**__ &lt;br /&gt;
**__ &lt;br /&gt;
**__ &lt;br /&gt;
**We need as many of you at this event&lt;/div&gt;</summary>
		<author><name>Wchen</name></author>
	</entry>
</feed>