Confirmed users
1,759
edits
(14 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
= General Info = | = General Info = | ||
* [June 2, 2017] This page seems outdated, and describes a manual procedure for setting up a Firefox for Android build and test environment. Currently, something like 'mach bootstrap && mach build && mach package && mach robocop' should replace all of this, under most circumstances. See https://wiki.mozilla.org/Mobile/Fennec/Android/Testing. | |||
* This document will help you set up the enviroment and create the builds to test, create and run automated tests using Robocop | * This document will help you set up the enviroment and create the builds to test, create and run automated tests using Robocop | ||
* In order to run the tests you will need one build to be installed on the device - the Firefox Mobile build - and a second desktop build to send the commands to device - the automation build. | * In order to run the tests you will need one build to be installed on the device - the Firefox Mobile build - and a second desktop build to send the commands to device - the automation build. | ||
Line 5: | Line 6: | ||
= Steps to setup enviroment and start running tests= | = Steps to setup enviroment and start running tests= | ||
'''Note''': | '''Note''': | ||
* If in the terminal you run "sudo su" '''remove the sudo command used before each command found here''' | * If in the terminal you run "sudo su" '''remove the sudo command used before each command found here''' | ||
* '''Do not run sudo mode when working with hg''' | * '''Do not run sudo mode when working with hg''' | ||
Line 19: | Line 19: | ||
= Detailed steps = | = Detailed steps = | ||
== Install Java == | == Install Java == | ||
Line 38: | Line 34: | ||
== Install ccache == | == Install ccache == | ||
* ccache will help | * ccache will help speed up the compilation process when recompilating newer versions of the code | ||
* Run in terminal | * Run in terminal | ||
sudo apt-get install ccache | sudo apt-get install ccache | ||
* Add ccache to the PATH variable | * Add ccache to the PATH variable | ||
**Enter root by running: | |||
sudo su | |||
**Run export to set the PATH variable | |||
export PATH=/usr/lib/ccache:$PATH | |||
* Extend the ccache to improve build time: | |||
ccache --max-size 8G | |||
== Install gold linker == | |||
* Using the gold linker improves the linking time reducing the compile time significantly | |||
sudo apt-get install binutils-gold | |||
== Install Mercurial == | == Install Mercurial == | ||
Line 59: | Line 64: | ||
[ui] | [ui] | ||
username = Your Real Name <user@example.com> | username = Your Real Name <user@example.com> | ||
merge = | merge = internal:merge | ||
[diff] | [diff] | ||
Line 68: | Line 73: | ||
[defaults] | [defaults] | ||
commit = -v | commit = -v | ||
=== Configure mq === | === Configure mq === | ||
Line 150: | Line 145: | ||
=== Install Android SDK === | === Install Android SDK === | ||
* Download the archive and unpack it | * Download the archive and unpack it | ||
wget http://dl.google.com/android/android- | wget http://dl.google.com/android/android-sdk_r22.0.5-linux.tgz | ||
tar -xzf android- | tar -xzf android-sdk_r22.0.5-linux.tgz | ||
=== Update Android SDK === | === Update Android SDK === | ||
* run | * You can run the update form the Android sdk manager. Just run the "android" script from android-sdk-dir/tools/. Current used version of Android SDK is 22.0.5 | ||
* Make sure you have Android SDK platform-tools 18.0.1 and Android SDK build-tools 17 and 18.0.1 | |||
* it is also a good idea to add the lines in the .profile file found in /home the command to make android sdk available from anywhere | * it is also a good idea to add the lines in the .profile file found in /home the command to make android sdk available from anywhere | ||
export PATH=$PATH:/home/<user>/android-sdk-linux/platform-tools:/home/<user>/android-sdk-linux/tools | export PATH=$PATH:/home/<user>/android-sdk-linux/platform-tools:/home/<user>/android-sdk-linux/tools | ||
=== Change permissions for SDK and NDK === | === Change permissions for SDK and NDK === | ||
* Change the permissions for | * Change the permissions for sdk and ndk and also for the .android folders to make sure they can be accessed from anywhere | ||
chmod 0777 -R sdk_or_ndk_dir | chmod 0777 -R sdk_or_ndk_dir | ||
chmod 0777 -R .android | |||
== Create .mozconfig files == | == Create .mozconfig files == | ||
Line 176: | Line 170: | ||
mk_add_options MOZ_OBJDIR=./objdir-firefox | mk_add_options MOZ_OBJDIR=./objdir-firefox | ||
=== Mozconfig for | === Mozconfig for ARMv7 (Firefox Mobile)=== | ||
<pre> . $topsrcdir/browser/config/mozconfig | <pre> . $topsrcdir/browser/config/mozconfig | ||
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-android | mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-android | ||
mk_add_options MOZ_MAKE_FLAGS="-s -j8" | mk_add_options MOZ_MAKE_FLAGS="-s -j8" | ||
ac_add_options --enable-debug | ac_add_options --enable-debug | ||
ac_add_options -- | ac_add_options --enable-optimize | ||
ac_add_options --with-ccache | ac_add_options --with-ccache | ||
ac_add_options --disable-crashreporter | ac_add_options --disable-crashreporter | ||
Line 192: | Line 186: | ||
ac_add_options --enable-application=mobile/android | ac_add_options --enable-application=mobile/android | ||
ac_add_options --target=arm-linux-androideabi | ac_add_options --target=arm-linux-androideabi | ||
ac_add_options --with-endian=little </pre> | |||
=== Mozconfig for ARMv6 builds === | |||
<pre> . $topsrcdir/browser/config/mozconfig | |||
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-android | |||
mk_add_options MOZ_MAKE_FLAGS="-s -j8" | |||
ac_add_options --enable-debug | |||
ac_add_options --enable-optimize | |||
ac_add_options --with-ccache | |||
ac_add_options --disable-crashreporter | |||
# Android SDK/NDK | |||
ac_add_options --with-android-ndk="/home/adriantamas/android-ndk-r8e" | |||
ac_add_options --with-android-sdk="/home/adriantamas/android-sdk-linux/platforms/android-16" | |||
ac_add_options --with-android-version=9 | |||
# Android options | |||
## Native UI: | |||
ac_add_options --enable-application=mobile/android | |||
ac_add_options --target=arm-linux-androideabi | |||
ac_add_options --with-arch=armv6 | |||
ac_add_options --with-endian=little | |||
export MOZ_PKG_SPECIAL=armv6</pre> | |||
=== Mozconfig for X86 === | |||
<pre> . $topsrcdir/browser/config/mozconfig | |||
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-android | |||
mk_add_options MOZ_MAKE_FLAGS="-s -j8" | |||
ac_add_options --enable-debug | |||
ac_add_options --enable-optimize | |||
ac_add_options --with-ccache | |||
ac_add_options --disable-crashreporter | |||
# Android SDK/NDK | |||
ac_add_options --with-android-ndk="/home/adriantamas/android-ndk-r8e" | |||
ac_add_options --with-android-sdk="/home/adriantamas/android-sdk-linux/platforms/android-16" | |||
ac_add_options --with-android-version=9 | |||
# Android options | |||
## Native UI: | |||
ac_add_options --enable-application=mobile/android | |||
ac_add_options --target=i386-linux-android | |||
ac_add_options --with-endian=little </pre> | ac_add_options --with-endian=little </pre> | ||
Line 237: | Line 271: | ||
=== Copy the terminal to a file for test results logging === | === Copy the terminal to a file for test results logging === | ||
make mochitest-robotium | tee logfile.txt | |||
or | or | ||
TEST_PATH=testLoad make mochitest-robocop | tee logfile.txt | |||
=== Run tests remotely via the SUTAgent === | === Run tests remotely via the SUTAgent === |