Building Android projects from the CLI should not require Android Studio to be installed/setup
Categories
(Fenix :: Tooling, defect, P2)
Tracking
(firefox133 fixed)
Tracking | Status | |
---|---|---|
firefox133 | --- | fixed |
People
(Reporter: jonalmeida, Assigned: adhingra, NeedInfo)
References
(Depends on 1 open bug, Blocks 2 open bugs)
Details
(Whiteboard: [fxdroid][group3])
Attachments
(1 file)
Today, Gecko developers need to go through quite a few steps still to build Fenix locally if they make platform changes and want to test them out on mobile apps.
Steps to reproduce
mach build
- Setup
JAVA_HOME
andANDROID_HOME
environment variables (because these cannot be found unless you usemach gradle
). - Generate a signing key (with CLI instructions are probably somewhere close to that link).
- Add
autosignReleaseWithDebugKey
tomobile/android/{android_app}/local.properties
. cd mobile/android/fenix
./gradlew installFenixRelease
Expected behaviour
- After
mach build
, you should be able to build (from the root or project directory) any of the mobile projects without needing more environment configurations outside ofmach bootstrap
. - You should not need to do step 2, 3, or 5.
- At step 6, you should be able to use
mach gradle installFenixRelease
instead.
Device information
- Firefox version: n/a
- Android device model: n/a
- Android OS version: n/a
Any additional information?
ANDROID_HOME
is needed because thesdk.dir
property inlocal.properties
is created by Android Studio.JAVA_HOME
is needed if you are going to executegradlew
in one of the app projects.- Both of the above would not need to be set if we can get
mach gradle
to recognize these projects from the root gradle.
Reporter | ||
Comment 1•11 months ago
|
||
This might be a solved problem if bug 1891130 is fixed, but it's not clear if there are more issues that will turn up after that, so filing this for now.
Comment 3•10 months ago
|
||
The severity field is not set for this bug.
:bclark, could you have a look please?
For more information, please visit BugBot documentation.
Updated•10 months ago
|
Updated•10 months ago
|
Updated•10 months ago
|
Assignee | ||
Comment 4•5 months ago
|
||
Updated•5 months ago
|
Updated•5 months ago
|
Updated•5 months ago
|
Comment 6•5 months ago
|
||
bugherder |
Assignee | ||
Comment 7•5 months ago
|
||
Just wanted to add a note here about the landed patch:
This patch adds the command: mach install --app=org.mozilla.fenix.release
which replaces steps, 2, 5, 6. Steps 1, 3 and 4 still need to be done before running this command as defined in the description! I don't have any ideas on how to add step 3 to this flow right now but please feel free to reopen this bug and change the priority if needed! Thanks!
(In reply to Aaditya Dhingra [:adhingra] from comment #7)
Just wanted to add a note here about the landed patch:
This patch adds the command:
mach install --app=org.mozilla.fenix.release
which replaces steps, 2, 5, 6. Steps 1, 3 and 4 still need to be done before running this command as defined in the description! I don't have any ideas on how to add step 3 to this flow right now but please feel free to reopen this bug and change the priority if needed! Thanks!
Surely it's possible to generate local keys as part of mach build
(or perhaps mach bootstrap
), and then use them during the (Gradle) build when required. We did this ages ago, pre-Gradle, using some manual keychain. You might want to mark the generated keys as "debug" keys, so that you can install with them across different devices.
Reporter | ||
Comment 9•5 months ago
|
||
(In reply to Nick Alexander :nalexander [he/him] from comment #8)
Surely it's possible to generate local keys as part of
mach build
(or perhapsmach bootstrap
), and then use them during the (Gradle) build when required. We did this ages ago, pre-Gradle, using some manual keychain. You might want to mark the generated keys as "debug" keys, so that you can install with them across different devices.
Specifically, I think it was this script that is no longer in central (but still in our esr68/fennec branch), but could give you the hints you need: https://searchfox.org/mozilla-esr68/source/mobile/android/debug_sign_tool.py
Comment 10•5 months ago
|
||
First thank you for adding this feature. Beside that I have one question:
Why do we actually have to specify release
or debug
? Cannot we retrieve it from the mozconfig settings? A build can only be release
or debug
so maybe we could just use mach install --app=org.mozilla.fenix
and it will automatically pick-up the correct build? Happy to file a follow-up bug if that makes sense.
Comment 11•4 months ago
|
||
Aaditya, maybe you can have a look at my last comment with questions? Thanks.
Assignee | ||
Comment 12•4 months ago
|
||
(In reply to Henrik Skupin [:whimboo][⌚️UTC+2] from comment #10)
First thank you for adding this feature. Beside that I have one question:
Why do we actually have to specify
release
ordebug
? Cannot we retrieve it from the mozconfig settings? A build can only berelease
ordebug
so maybe we could just usemach install --app=org.mozilla.fenix
and it will automatically pick-up the correct build? Happy to file a follow-up bug if that makes sense.
Hey, I apologize, I missed this comment before! I wasn't aware that this was an option or that "a build can only be release or debug". I will surely look into it now! Please feel free to file a follow up bug for this! Thanks!
Description
•