X Tutup
Skip to content

Add a Swappy installation script for easier Android builds#108674

Merged
akien-mga merged 1 commit intogodotengine:masterfrom
Calinou:add-swappy-install-script
Dec 18, 2025
Merged

Add a Swappy installation script for easier Android builds#108674
akien-mga merged 1 commit intogodotengine:masterfrom
Calinou:add-swappy-install-script

Conversation

@Calinou
Copy link
Member

@Calinou Calinou commented Jul 16, 2025

Run python misc/scripts/install_swappy_android.py and Swappy libraries will automatically be installed to the correct location.

Run the script again when needed to update to the latest version.

This could likely be cherry-picked to 4.5.

@beicause
Copy link
Contributor

It would be better to mention the installation script here, or automatically run it if env["swappy"] is true and swappy is missing:

if not has_swappy:
print_warning(
"Swappy Frame Pacing not detected! It is strongly recommended you download it from https://github.com/godotengine/godot-swappy/releases and extract it so that the following files can be found:\n"
+ " thirdparty/swappy-frame-pacing/arm64-v8a/libswappy_static.a\n"
+ " thirdparty/swappy-frame-pacing/armeabi-v7a/libswappy_static.a\n"
+ " thirdparty/swappy-frame-pacing/x86/libswappy_static.a\n"
+ " thirdparty/swappy-frame-pacing/x86_64/libswappy_static.a\n"
+ "Without Swappy, Godot apps on Android will inevitable suffer stutter and struggle to keep consistent 30/60/90/120 fps. Though Swappy cannot guarantee your app will be stutter-free, not having Swappy will guarantee there will be stutter even on the best phones and the most simple of scenes."
)
if env["swappy"]:
print_error("Use build option `swappy=no` to ignore missing Swappy dependency and build without it.")
sys.exit(255)

@Calinou Calinou force-pushed the add-swappy-install-script branch from 8b6f8e8 to b1284f4 Compare July 18, 2025 14:31
@Calinou
Copy link
Member Author

Calinou commented Jul 18, 2025

It would be better to mention the installation script here, or automatically run it if env["swappy"] is true and swappy is missing:

I've added a mention of the script in the warning. I think in the future, we should probably move towards making Swappy a hard requirement to build Godot with the default options, so that we can ensure all APKs are built with it enabled. The installation script should remove most of the friction already. We could keep support for explicitly passing swappy=no for those who really need it, but I would ensure the default options lead to an APK with a good user experience.

Running scripts that download things from the Internet without prompting the user is a contentious issue in a buildsystem though (Linux distributions and Flathub's build system don't allow it). Therefore, the script should still be run manually before building for now.

@Calinou Calinou force-pushed the add-swappy-install-script branch 2 times, most recently from 7f41ea7 to df3faa4 Compare July 21, 2025 23:15
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.

Tiny fix aside, this looks good to me.

Run `python misc/scripts/install_swappy_android.py` and Swappy
libraries will automatically be installed to the correct location.

Run the script again when needed to update to the latest version.
@Calinou Calinou force-pushed the add-swappy-install-script branch from df3faa4 to 683f0c0 Compare December 18, 2025 01:24
@akien-mga akien-mga merged commit cc1f229 into godotengine:master Dec 18, 2025
20 checks passed
@akien-mga
Copy link
Member

Thanks!

@Calinou Calinou deleted the add-swappy-install-script branch February 10, 2026 17:53
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.

4 participants

X Tutup