La herramienta androiddeployqt
La creación de un paquete para Android implica muchos pasos, por lo que Qt incluye una herramienta que se encarga de todo por ti. Los pasos que gestiona la herramienta Android Deploy Qt se describen en «Implementación de una aplicación en Android».
Requisitos previos antes de ejecutar androiddeployqt
Antes de ejecutar la herramienta manualmente, debes configurar tu proyecto con CMake o qmake para generar Makefiles y un archivo JSON (por ejemplo, android-<target_name>-deployment-settings.json) que contenga ajustes importantes utilizados por androiddeployqt.
Nota: Nose recomienda modificar el archivo JSON de androiddeployqt.
Para preparar el entorno para androiddeployqt, configura tu proyecto en un directorio distinto al de tu código fuente. Para obtener más información sobre cómo configurar tu proyecto, consulta «Compilación de proyectos Qt para Android desde la línea de comandos».
Argumentos de la línea de comandos
Los únicos argumentos de línea de comandos obligatorios al ejecutar la herramienta son --input y --output. El resto de argumentos de línea de comandos son opcionales, pero útiles. La lista que figura a continuación está disponible al pasar el argumento --help a androiddeployqt.
Syntax: androiddeployqt --output <destination> [options]
Creates an Android package in the build directory <destination> and
builds it into an .apk file.
Optional arguments:
--input <inputfile>: Reads <inputfile> for options generated by
qmake. A default file name based on the current working
directory will be used if nothing else is specified.
--deployment <mechanism>: Supported deployment mechanisms:
bundled (default): Includes Qt files in stand-alone package.
unbundled: Assumes native libraries are present on the device
and does not include them in the APK.
--aab: Build an Android App Bundle.
--no-build: Do not build the package, it is useful to just install
a package previously built.
--install: Installs apk to device/emulator. By default this step is
not taken. If the application has previously been installed on
the device, it will be uninstalled first.
--reinstall: Installs apk to device/emulator. By default this step
is not taken. If the application has previously been installed on
the device, it will be overwritten, but its data will be left
intact.
--device [device ID]: Use specified device for deployment. Default
is the device selected by default by adb.
--android-platform <platform>: Builds against the given android
platform. By default, the highest available version will be
used.
--release: Builds a package ready for release. By default, the
package will be signed with a debug key.
--sign <url/to/keystore> <alias>: Signs the package with the
specified keystore, alias and store password.
Optional arguments for use with signing:
--storepass <password>: Keystore password.
--storetype <type>: Keystore type.
--keypass <password>: Password for private key (if different
from keystore password.)
--sigfile <file>: Name of .SF/.DSA file.
--digestalg <name>: Name of digest algorithm. Default is
"SHA-256".
--sigalg <name>: Name of signature algorithm. Default is
"SHA256withRSA".
--tsa <url>: Location of the Time Stamping Authority.
--tsacert <alias>: Public key certificate for TSA.
--internalsf: Include the .SF file inside the signature block.
--sectionsonly: Do not compute hash of entire manifest.
--protected: Keystore has protected authentication path.
--jarsigner: Deprecated, ignored.
NOTE: To conceal the keystore information, the environment variables
QT_ANDROID_KEYSTORE_PATH, and QT_ANDROID_KEYSTORE_ALIAS are used to
set the values keysotore and alias respectively.
Also the environment variables QT_ANDROID_KEYSTORE_STORE_PASS,
and QT_ANDROID_KEYSTORE_KEY_PASS are used to set the store and key
passwords respectively. This option needs only the --sign parameter.
--jdk <path/to/jdk>: Used to find the jarsigner tool when used
in combination with the --release argument. By default,
an attempt is made to detect the tool using the JAVA_HOME and
PATH environment variables, in that order.
--qml-import-paths: Specify additional search paths for QML
imports.
--verbose: Prints out information during processing.
--no-generated-assets-cache: Do not pregenerate the entry list for
the assets file engine.
--aux-mode: Operate in auxiliary mode. This will only copy the
dependencies into the build directory and update the XML templates.
The project will not be built or installed.
--apk <path/where/to/copy/the/apk>: Path where to copy the built apk.
--build-aar: Build an AAR package. This option skips --aab, --install,
--reinstall, and --sign options if they are provided.
--qml-importscanner-binary <path/to/qmlimportscanner>: Override the
default qmlimportscanner binary path. By default the
qmlimportscanner binary is located using the Qt directory
specified in the input file.
--depfile <path/to/depfile>: Output a dependency file.
--builddir <path/to/build/directory>: build directory. Necessary when
generating a depfile because ninja requires relative paths.
--no-rcc-bundle-cleanup: skip cleaning rcc bundle directory after
running androiddeployqt. This option simplifies debugging of
the resource bundle content, but it should not be used when deploying
a project, since it litters the "assets" directory.
--copy-dependencies-only: resolve application dependencies and stop
deploying process after all libraries and resources that the
application depends on have been copied.
--help: Displays this information.Con un ` project_name`, para compilar el paquete de la aplicación con ` androiddeployqt ` sin implementarlo en el dispositivo, ejecuta lo siguiente:
androiddeployqt --input <build_dir>/android-project_name-deployment-settings.json \
--output <build_dir>/android-buildPara compilar e implementar el paquete en el dispositivo:
androiddeployqt --input <build_dir>/android-project_name-deployment-settings.json \
--output <build_dir>/android-build --install --device <device_serial_id>Detección de dependencias
Qt incluye una serie de complementos que se cargan en tiempo de ejecución cuando son necesarios. Estos pueden encargarse de cualquier tarea, desde conectarse a bases de datos SQL hasta cargar formatos de imagen específicos. Detectar las dependencias de los complementos es imposible, ya que estos se cargan en tiempo de ejecución, pero androiddeployqt intenta adivinar dichas dependencias basándose en las dependencias de Qt de tu aplicación. Si el complemento tiene alguna dependencia de Qt que no sea también una dependencia de tu aplicación, no se incluirá por defecto. Por ejemplo, para asegurarte de que se incluya el complemento del formato de imagen SVG, tendrás que añadir el Qt SVG módulo a tu proyecto para que se convierta en una dependencia de tu aplicación:
find_package(Qt6 REQUIRED COMPONENTS Svg)
...
target_link_libraries(target_name PRIVATE Qt6::Svg)Si te preguntas por qué un complemento concreto no se incluye automáticamente, puedes ejecutar androiddeployqt con la opción « --verbose » para obtener la lista de dependencias que faltan para cada complemento excluido. Puedes conseguir lo mismo en Qt Creator marcando la casilla « Verbose output » en « Projects » > « Build Steps » > « Build Android APK » > « Advanced Actions ».
También es posible especificar manualmente las dependencias de tu aplicación. Para obtener más información, consulta la variable CMake QT_ANDROID_DEPLOYMENT_DEPENDENCIES.
Nota: androiddeployqt analiza los archivos QML del proyecto para recopilar las importaciones de QML. Sin embargo, si estás cargando código QML como un « QString » desde C++ en tiempo de ejecución, es posible que no funcione correctamente, ya que androiddeployqt no lo detectará en el momento de la implementación. Para solucionarlo, puedes añadir un archivo QML ficticio que importe dichos módulos QML a los que se hace referencia en tiempo de ejecución.
Implementación en Qt Creator
Qt Creator utiliza « androiddeployqt » en segundo plano y ofrece interfaces de usuario sencillas e intuitivas para especificar diversas opciones. Para obtener más información, consulta Qt Creator: Configuración de la implementación de Android.
Para obtener más información sobre cómo personalizar e implementar una aplicación Qt para Android, consulta «Implementación de una aplicación en Android».
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.