Skip to content

Commit

Permalink
Bug 1829017 - Add a synthetic document about how to build Firefox for…
Browse files Browse the repository at this point in the history
… Android. r=sylvestre

Differential Revision: https://phabricator.services.mozilla.com/D175962
  • Loading branch information
glandium committed May 10, 2023
1 parent a6a722e commit a5e959a
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/contributing/build/building_mobile_firefox.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ devices, and audiences:
- Building **Firefox for Android** (codename: fenix). Our general-purpose
mobile browser is split into several different artifact layers:

- `The fenix Android application <https://github.com/mozilla-mobile/firefox-android/tree/main/fenix>`_
- `The fenix Android application </mobile/android/fenix.html>`_
- `The android-components Android library <https://github.com/mozilla-mobile/firefox-android/tree/main/android-components>`_
- `The GeckoView platform <https://firefox-source-docs.mozilla.org/mobile/android/geckoview/index.html>`_
- `The GeckoView platform </mobile/android/geckoview>`_

- `Firefox for iOS <https://github.com/mozilla-mobile/firefox-ios>`_,
our general-purpose browser for iOS with desktop sync built-in.
Expand Down
51 changes: 51 additions & 0 deletions mobile/android/docs/fenix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
Building Firefox for Android
============================

First, you'll want to `set up your machine to build Firefox </setup>`_.
Follow the instructions there, choosing "GeckoView/Firefox for Android" as
the bootstrap option.

Once you're set up and have a GeckoView build from the above, please
continue with the following steps.

1. Clone the repository and initial setup
-----------------------------------------

.. code-block:: shell
git clone https://github.com/mozilla-mobile/firefox-android
cd firefox-android/fenix
echo dependencySubstitutions.geckoviewTopsrcdir=/path/to/mozilla-central > local.properties
replace `/path/to/mozilla-central` with the location of your mozilla-central/mozilla-unified source tree.

2. Build
--------

.. code-block:: shell
export JAVA_HOME=$HOME/.mozbuild/jdk/jdk-17.0.6+10
export ANDROID_HOME=$HOME/.mozbuild/android-sdk-<os_name>
./gradlew clean app:assembleDebug
`<os_name>` is either `linux`, `macosx` or `windows` depending on the OS you're building from.


For more details, check out the `more complete documentation <https://github.com/mozilla-mobile/firefox-android/tree/main/fenix>`_.

3. Run
------

From the gecko working directory:

.. code-block:: shell
./mach android-emulator
From the firefox-android working directory:

.. code-block:: shell
./gradlew :app:installFenixDebug
"$ANDROID_HOME/platform-tools/adb" shell am start -n org.mozilla.fenix.debug/org.mozilla.fenix.debug.App

0 comments on commit a5e959a

Please sign in to comment.