Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
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 Key password, encrypted by \c hvigor.
120
\row
121
\li \c {--signing-store-password <s>}
122
\li \c QT_HARMONYOS_SIGNING_STORE_PASSWORD
123
\li Keystore password, encrypted by \c hvigor.
124
\row
125
\li \c {--signing-plain-key-password <s>}
126
\li \c QT_HARMONYOS_SIGNING_PLAIN_KEY_PASSWORD
127
\li Key password, in plain text.
128
\row
129
\li \c {--signing-plain-store-password <s>}
130
\li \c QT_HARMONYOS_SIGNING_PLAIN_STORE_PASSWORD
131
\li Keystore password, in plain text.
132
\row
133
\li \c {--signing-alg <alg>}
134
\li \c QT_HARMONYOS_SIGNING_ALG
135
\li Signature algorithm. Defaults to \c SHA256withECDSA.
136
\endtable
137
138
Signing is all-or-nothing: if any signing input is set, all six required
139
values (the certificate, profile, keystore, key alias, key password, and
140
keystore password) must be present, otherwise \c harmonydeployqt fails. With
141
none of them set, the HAP is left unsigned.
142
143
Pass each password in one form only, and both in the same form.
144
145
With encrypted passwords, \c harmonydeployqt writes the signing material
146
into the \c signingConfigs of the generated \c build-profile.json5, and
147
\c hvigor signs the HAP. \c hvigor can only decrypt passwords that were
148
encrypted against the material directory it finds, such as the ones DevEco
149
Studio writes into \c build-profile.json5.
150
151
With plain passwords, \c harmonydeployqt signs the HAP with
152
\c hap-sign-tool from the HarmonyOS SDK, after \c hvigor has packaged it.
153
This does not depend on DevEco Studio. The tool is looked up under the SDK
154
root, or at \c QT_HARMONYOS_HAP_SIGN_TOOL if that is set. It needs a Java
155
runtime, taken from \c QT_HARMONYOS_JAVA, from \c JAVA_HOME, or from
156
\c PATH.
157
158
\note Plain passwords are passed to \c hap-sign-tool on its command line,
159
which is the only input mode it supports in a non-interactive build. They
160
are visible to other processes on the machine while it runs.
161
162
\section1 Running the application
163
164
Install and run the resulting HAP on a connected HarmonyOS device or on the
165
emulator. The most convenient way to deploy and debug is to open the
166
generated project in
167
\l{https://developer.huawei.com/consumer/en/deveco-studio/}{DevEco Studio}
168
and use its run and debug tooling.
169
170
For more information about packaging and deploying a Qt application for
171
HarmonyOS, see \l{Building and Deploying Qt Applications for HarmonyOS}.
172
*/
qtbase
src
tools
harmonydeployqt
doc
src
harmonydeployqt.qdoc
Generated on
for Qt by
1.18.0