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

[Android editor] Enable automatic install of exported apks for the Android editor #97631

Merged

Conversation

m4gr3d
Copy link
Contributor

@m4gr3d m4gr3d commented Sep 30, 2024

Adds support for automatically installing the exported APK for the Android editor.
An editor setting is added as well to allow enabling / disabling the feature (enabled by default).

1000059686.mp4

@llama-nl
Copy link

Can you add Gradle build support for Android Editor? It will be vary useful.

@m4gr3d m4gr3d requested a review from Calinou October 24, 2024 16:17
Copy link
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

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

Tested locally on a Samsung Galaxy Z Fold4 running Android 14, it works as expected. I've only tested the debug export, as release export can't be done using the built-in debug keystore (the autogenerated keystore path starting with assets:// isn't considered valid in the Export dialog).

The exported project (Truck Town in this case) runs successfully after installation.

Code looks good to me.

PS: In the future, we could integrate similar "run after export" options for desktop and web platforms.

Copy link
Member

@syntaxerror247 syntaxerror247 left a comment

Choose a reason for hiding this comment

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

I think we should keep it's default to false.
Auto-installing by default might inadvertently replace an existing version of the app on the device, which could be disruptive if the installed version contains different configurations or data that user want to keep separate from the newly exported build.

@m4gr3d
Copy link
Contributor Author

m4gr3d commented Oct 28, 2024

I think we should keep it's default to false. Auto-installing by default might inadvertently replace an existing version of the app on the device, which could be disruptive if the installed version contains different configurations or data that user want to keep separate from the newly exported build.

I am not sure I understand the concern:

  • the feature is only for the Android editor which means that a previous install would have also been likely added by the Android editor
  • the auto-install feature only applies to an exported project build meaning that is the dev has already gone through the intent of generating the build. If installing is not desired, then the dev can still cancel the installation (a dialog prompt is shown prior to installation)
  • Upgrade to existing Android apps conserve the app data so no risk of loosing data unless the dev decides to uninstall the app first

@syntaxerror247
Copy link
Member

I personally use my own apps, and during development there are many times when I make breaking changes that can also lead to corruption of the saved data. That's why I test my apps on a new user profile. I believe keeping this feature enabled by default could lead to unwanted installations if users aren't aware of it.

If installing is not desired, then the dev can still cancel the installation (a dialog prompt is shown prior to installation)

Oh, I wasn't aware of that. If a dialog is shown, then it should be fine.

@m4gr3d m4gr3d force-pushed the prompt_apk_install_after_generation branch from fd6c451 to af2423b Compare October 28, 2024 23:12
@m4gr3d
Copy link
Contributor Author

m4gr3d commented Oct 28, 2024

Oh, I wasn't aware of that. If a dialog is shown, then it should be fine.

@syntaxerror247 I've updated the description with a video of the install flow for illustration.

@Repiteo Repiteo merged commit b00e1cb into godotengine:master Nov 5, 2024
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Nov 5, 2024

Thanks!

@m4gr3d m4gr3d deleted the prompt_apk_install_after_generation branch November 5, 2024 05:18
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.

5 participants