summaryrefslogtreecommitdiffstats
path: root/mobile/android/docs/fenix.rst
blob: c22e55cc288e38b00f6ad1fc11c6369bbc5890eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
.. _fenix-contributor-guide:

Building Firefox for Android
============================

Run Fenix using command line
----------------------------

As a first step, you need to set up your development environment using the instruction :ref:`here <firefox_for_android>`.


Run Fenix or other Android projects using command line
---------------------------------------------------------
.. _run_fenix_from_commandline:

From the root mozilla-central directory, you can run an emulator with the following command:

.. code-block:: shell

    ./mach android-emulator

From the `mobile/android/fenix` working directory, build, install and launch Fenix with:

.. code-block:: shell

    export JAVA_HOME=$HOME/.mozbuild/jdk/jdk-<latest-version>
    export ANDROID_HOME=$HOME/.mozbuild/android-sdk-<os_name>
    ./gradlew :app:installFenixDebug
    "$ANDROID_HOME/platform-tools/adb" shell am start -n org.mozilla.fenix.debug/org.mozilla.fenix.debug.App


Run Fenix tests
-------------------

You can run tests via all the normal routes:

- For individual test files, click the little green play button at the top
- For a module/component:

   - Right click in project explorer → run all tests
   - Select from gradle tasks window
   - On command line: ``./gradlew :$module:$variant`` e.g.  ``./gradlew :feature-downloads:testDebugUnitTest``

If you see the error "Test events were not received", check your top level folder - this happens if you try and run tests in Android Components from ``mozilla-unified/mobile/android/fenix/``.
To build tests for Android Components you need to be using the ``build.gradle`` in ``mozilla-unified/mobile/android/android-components/``.

If after running tests on your Android device, you can no longer long press, this is because the connected Android tests mess around with your phone’s accessibility settings.
They set the long press delay to 3 seconds, which is an uncomfortably long time.
To fix this, go to Settings → Accessibility → Touch and hold delay, and reset this to default or short (depends on manufacturer).