Search code examples
androidqtqt5apkqt-creator

Android Package Kit file name for Qt application


When QtC builds android package it always get name android-build-debug.apk regardless application name, release or debug build, etc. How to change it to something like appname-{version}-{prefix}.apk, what file need to change: AndroidManifest.xml, build.gradle, .pro?


Solution

  • Short answer: You can't easily change it. You should just rename it manually.


    Long answer:

    The name is generated based on the directory the android build was performed in, combined with the android build mode: <dir-name>-<build-mode>. Possible build modes are debug, release-unsigned and release-signed, depending on your project configuration.

    If you are working with QtCreator, there is nothing really you can do about the directory part though, unless you disable the default build steps and replace them by custom build steps that perform the same operation, but in a different directory.

    You would have to add a custom install step that installs to a custom directory named after how the apk should be named and then add another custom step that calls androiddeployqt with the correct parameters (The same as the default step, but with your custom directory instead)`.

    It is as complicated as it sounds, and I would not recommend you to do that. Instead simply rename the binary manually. You could add a custom build step after the normal android steps to do that, if you really want to automate it.