Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add generate_apk=yes to generate an APK after building #84440

Merged

Conversation

Calinou
Copy link
Member

@Calinou Calinou commented Nov 4, 2023

This is useful to speed up iteration when working on the engine (or editor). If you need multiple architectures in the APK, specify generate_apk=yes when building the last architecture you're interested in only.

This can be combined with a script that calls adb to deploy the APK on a device (coupled with Godot's --export-* for projects) to further speed up iteration.

Gradle output is set to --quiet, which means it only leaves persistent messages on errors (progress is visible inline while building):

scons: Reading SConscript files ...
Checking for Android NDK...
Building for platform "android", architecture "arm64", target "template_release".
Checking for C header file mntent.h... (cached) yes
scons: done reading SConscript files.
scons: Building targets ...
Linking Shared Library bin/libgodot.android.template_release.arm64.so ...
progress_finish(["progress_finish"], [])
generate_apk(["platform/android/generate_apk"], [])
scons: done building targets.
[Time elapsed: 00:00:08.836]

Copy link
Contributor

@m4gr3d m4gr3d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

platform/android/SCsub Outdated Show resolved Hide resolved
Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Added a suggestion for further improvements.

@Calinou Calinou force-pushed the scons-android-add-generate-apk-option branch from 3c674ed to 27343b0 Compare December 12, 2023 15:10
@Calinou
Copy link
Member Author

Calinou commented Dec 12, 2023

Looks good to me. Added a suggestion for further improvements.

Done. Note that using generate_apk=yes with Android editor also generates an .aab file alongside in bin/android_editor_builds. Should I rename the option accordingly?

❯ ll -B bin/android_editor_builds 
Permissions       Size User Date Modified Name
.rw-r--r--@ 48,123,516 hugo 12 Dec 16:09  android_editor-dev.aab
.rw-r--r--@ 52,210,553 hugo 12 Dec 16:09  android_editor-dev.apk

@akien-mga
Copy link
Member

I think it's fine to use "apk" as a shorthand for Android app package which can be either apk or aab. Might be worth mentioning AAB in the description of the option.

@Calinou Calinou force-pushed the scons-android-add-generate-apk-option branch from 27343b0 to 4c41bcf Compare December 12, 2023 16:00
@Calinou
Copy link
Member Author

Calinou commented Dec 12, 2023

Might be worth mentioning AAB in the description of the option.

Done 🙂

@akien-mga
Copy link
Member

Needs running black -l120 or shortening the description to keep it on one line.

This is useful to speed up iteration when working on the engine
(or editor).

This can be combined with a script that calls `adb` to deploy the APK
on a device (coupled with Godot's `--export-*` for projects)
to further speed up iteration.
@Calinou Calinou force-pushed the scons-android-add-generate-apk-option branch from 4c41bcf to 18152ac Compare December 12, 2023 23:28
@akien-mga akien-mga merged commit 2966db7 into godotengine:master Dec 13, 2023
15 checks passed
@akien-mga
Copy link
Member

Thanks!

@Calinou Calinou deleted the scons-android-add-generate-apk-option branch December 19, 2023 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants