このページについて

androiddeployqt ツール

Androidパッケージのビルドには多くの手順が必要となるため、Qtにはその作業を代行するツールが付属しています。Android Deploy Qtツールが処理する手順については、「Androidへのアプリケーションのデプロイ」で説明されています。

androiddeployqt を実行する前の前提条件

このツールを手動で実行する前に、CMake またはqmake を使用してプロジェクトを設定し、Makefiles およびJSON ファイル(例:android-<target_name>-deployment-settings.json )を生成する必要があります。これらのファイルには、androiddeployqt が使用する重要な設定が含まれています。

注: androiddeployqtのJSONファイルを変更することは推奨されません。

androiddeployqt 用の環境を準備するには、プロジェクトをソースディレクトリとは別のディレクトリに構成してください。プロジェクトの構成に関する詳細については、「コマンドラインからの Qt for Android プロジェクトのビルド」を参照してください。

コマンドライン引数

このツールを実行する際に必須のコマンドライン引数は、--input および--output のみです。その他のコマンドライン引数はオプションですが、便利です。以下のリストは、androiddeployqtに--help 引数を指定することで利用可能です。

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.

project_name を指定し、androiddeployqt を使用してアプリケーションパッケージをビルドし、デバイスにデプロイせずに済むようにするには、次のように実行します。

androiddeployqt --input <build_dir>/android-project_name-deployment-settings.json \
                --output <build_dir>/android-build

パッケージをビルドしてデバイスにデプロイするには:

androiddeployqt --input <build_dir>/android-project_name-deployment-settings.json \
                --output <build_dir>/android-build --install --device <device_serial_id>

依存関係の検出

Qt には、必要に応じて実行時に読み込まれる多数のプラグインが付属しています。これらは、SQL データベースへの接続から特定の画像形式の読み込みに至るまで、あらゆる処理を処理できます。 プラグインは実行時に読み込まれるため、その依存関係を検出することは不可能ですが、androiddeployqt はアプリケーションの Qt 依存関係に基づいて、そのような依存関係を推測しようとします。プラグインに、アプリケーションの依存関係に含まれていない Qt 依存関係がある場合、そのプラグインはデフォルトでは含まれません。 たとえば、SVG 画像形式プラグインを確実に含めるには、 Qt SVG モジュールを追加し、それをアプリケーションの依存関係にする必要があります:

find_package(Qt6 REQUIRED COMPONENTS Svg)
...
target_link_libraries(target_name PRIVATE Qt6::Svg)

特定のプラグインが自動的に含まれない理由を知りたい場合は、`androiddeployqt`を--verbose オプション付きで実行すると、除外された各プラグインについて不足している依存関係のリストを取得できます。また、Qt Creator で、[Projects ] > [Build Steps ] > [Build Android APK ] > [Advanced Actions] の順に進み、[Verbose output ]チェックボックスをオンにすることで、同様の結果を得ることができます。

また、アプリケーションの依存関係を手動で指定することも可能です。詳細については、CMake変数「QT_ANDROID_DEPLOYMENT_DEPENDENCIES」を参照してください。

注:androiddeployqt はプロジェクトの QML ファイルをスキャンして、QML のインポート情報を収集します。ただし、実行時に C++ からQString として QML コードを読み込んでいる場合、デプロイ時に androiddeployqt がそれを認識できないため、正常に動作しない可能性があります。 これを回避するには、実行時に参照されるようなQMLモジュールをインポートするダミーのQMLファイルを追加してください。

デプロイについてQt Creator

Qt Creator では、内部でandroiddeployqt を使用しており、さまざまなオプションを指定するための簡単で直感的なユーザーインターフェースを提供しています。詳細については、Qt Creator: Android Deploy Configurationを参照してください。

Qt for Android アプリのカスタマイズおよびデプロイに関する詳細については、「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.