Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
harmonydeployqt.qdoc
Go to the documentation of this file.
1// Copyright (C) 2026 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
3
4/*!
5 \page harmonyos-deploy-qt-tool.html
6 \brief An overview of the harmonydeployqt tool and how to use it.
7 \title The harmonydeployqt Tool
8
9 \target harmonydeployqt
10
11 \note Qt for HarmonyOS is in technology preview and may change in future
12 releases.
13
14 Packaging a Qt application for HarmonyOS involves many steps, so Qt comes
15 with a tool that handles the work for you. Building the CMake
16 \c {<target>_make_hap} target runs \c harmonydeployqt automatically, so you
17 normally do not invoke it manually. The overall packaging and deployment
18 process is described in \l{Building and Deploying Qt Applications for
19 HarmonyOS}.
20
21 \section1 How it works
22
23 Like \l{The androiddeployqt Tool}{androiddeployqt}, \c harmonydeployqt
24 collects everything the application needs to run and assembles a deployable
25 package:
26
27 \list
28 \li It gathers the application's shared library, the HarmonyOS platform
29 plugin (\c libqohos.so), the required Qt modules and plugins, and,
30 for Qt Quick applications, the QML modules.
31 \li It places these into a HarmonyOS application template together with
32 the metadata and permissions declared through the
33 \l{Qt for HarmonyOS CMake API}.
34 \li It invokes the OpenHarmony \c hvigor build tool to assemble the
35 final HarmonyOS Ability Package (HAP).
36 \endlist
37
38 The settings that drive this process are passed to the tool in a JSON
39 configuration file, which the CMake build generates for you.
40
41 \section1 Command-line arguments
42
43 The only required argument is \c {--input}. The list below is also available
44 by passing \c {--help} to \c harmonydeployqt.
45
46 \table
47 \header
48 \li Argument
49 \li Description
50 \row
51 \li \c {--input <file>}
52 \li JSON configuration file describing the application and the Qt
53 installation to deploy. Required.
54 \row
55 \li \c {--output <dir>}
56 \li Output directory for the generated HarmonyOS project.
57 \row
58 \li \c {--hvigor <path>}
59 \li Path to the \c hvigorw script used to build the HAP. Can also be set
60 with the \c QT_HARMONYOS_HVIGOR environment variable.
61 \row
62 \li \c {--install}
63 \li Install the resulting HAP to a connected device using \c hdc.
64 \row
65 \li \c {--release}
66 \li Build the release configuration. The default is debug.
67 \row
68 \li \c {--no-build}
69 \li Generate the HarmonyOS project but skip building the HAP.
70 \row
71 \li \c {--test-bundle}
72 \li Enable test bundle mode, which bundles all test binaries into a
73 single HAP.
74 \row
75 \li \c {--verbose}
76 \li Enable verbose output.
77 \row
78 \li \c {--depfile <path>}
79 \li Write a dependency file for the build system to the given path.
80 \row
81 \li \c {--depfile-base <dir>}
82 \li Base directory used for relative paths in the dependency file.
83 \row
84 \li \c {--help}
85 \li Display the list of available arguments.
86 \endtable
87
88 \section1 Signing the HAP
89
90 A HAP must be signed before it can be installed on a device. You can provide
91 the signing material either through command-line arguments or through
92 the matching environment variables. When both are given, the command-line
93 argument wins for that individual field.
94
95 \table
96 \header
97 \li Argument
98 \li Environment variable
99 \li Description
100 \row
101 \li \c {--signing-cert-path <p>}
102 \li \c QT_HARMONYOS_SIGNING_CERT_PATH
103 \li Path to the \c .cer certificate file.
104 \row
105 \li \c {--signing-profile <p>}
106 \li \c QT_HARMONYOS_SIGNING_PROFILE
107 \li Path to the \c .p7b provisioning profile.
108 \row
109 \li \c {--signing-store-file <p>}
110 \li \c QT_HARMONYOS_SIGNING_STORE_FILE
111 \li Path to the \c .p12 keystore.
112 \row
113 \li \c {--signing-key-alias <a>}
114 \li \c QT_HARMONYOS_SIGNING_KEY_ALIAS
115 \li Key alias inside the keystore.
116 \row
117 \li \c {--signing-key-password <s>}
118 \li \c QT_HARMONYOS_SIGNING_KEY_PASSWORD
119 \li Encrypted key password.
120 \row
121 \li \c {--signing-store-password <s>}
122 \li \c QT_HARMONYOS_SIGNING_STORE_PASSWORD
123 \li Encrypted keystore password.
124 \row
125 \li \c {--signing-alg <alg>}
126 \li \c QT_HARMONYOS_SIGNING_ALG
127 \li Signature algorithm. Defaults to \c SHA256withECDSA.
128 \endtable
129
130 The passwords must be \c hvigor-encrypted blobs, not plain text. Signing is
131 all-or-nothing: if any signing input is set, all six required values (the
132 certificate, profile, keystore, key alias, key password, and keystore
133 password) must be present. Otherwise the HAP is left unsigned.
134
135 \section1 Running the application
136
137 Install and run the resulting HAP on a connected HarmonyOS device or on the
138 emulator. The most convenient way to deploy and debug is to open the
139 generated project in
140 \l{https://developer.huawei.com/consumer/en/deveco-studio/}{DevEco Studio}
141 and use its run and debug tooling.
142
143 For more information about packaging and deploying a Qt application for
144 HarmonyOS, see \l{Building and Deploying Qt Applications for HarmonyOS}.
145*/