ECMAddAndroidApk

Functions for creating Android APK packages using Qt6’s androiddeployqt tool as well as the associated Fastlane metadata.

ecm_add_android_apk(<target>
    [ANDROID_DIR <dir>]
    # TODO extra args?
)

Creates an Android APK for the given target.

If ANDROID_DIR is given, the Android manifest file as well as any potential Gradle build system files or Java/Kotlin source files are taken from that directory. If not set, the standard template shipped with Qt6 is used, which in usually not what you want for production applications.

The use of this function creates a build target called create-apk-<target> which will run androiddeployqt to produce an (unsigned) APK, as well as convert Appstream application metadata (if present) into the Fastlane format used by F-Droid and Play store automation.

There’s also a create-apk convenience target being created that will build all APKs defined in a project.

When building for another platform than Android, this function does nothing.

The following variables impact the behavior: ECM_ADDITIONAL_FIND_ROOT_PATH

See documentation in the Android toolchain file.

ECM_APK_STAGING_ROOT_PATH

For use with Craft’s image directory. If set this is used as the source for all content of the APK rather than the search paths used for building. This allows to separate e.g. development files from what ends up in the APK.

Since 6.0.0