Specify HarmonyOS deploy settings

A HarmonyOS device runs an application from a signed HarmonyOS Ability Package (.hap), so deploying means building one. Go to Projects > Deploy Settings to see the steps of Deploy to HarmonyOS device:

  1. Build HarmonyOS package (.hap) collects what the application needs. It runs harmonydeployqt to stage the Qt libraries, the QML imports and the plugins, adds the libraries the staged ones need in turn, and generates the hvigor project.
  2. Package HarmonyOS application with hvigor turns that project into an unsigned package.
  3. Sign HarmonyOS package signs it with hap-sign-tool.jar and the material from Preferences > SDKs > HarmonyOS.
  4. Install HarmonyOS package with hdc installs it on the device.

Turn off Run without installing in Preferences > SDKs > HarmonyOS to always reinstall, which is what a changed package needs.

Libraries the device does not have

Qt links against ICU, fontconfig, freetype, and libpng, but a HarmonyOS device carries none of them. Set Additional packages to the prefix they are installed under, and the kit passes it to the build as QT_ADDITIONAL_PACKAGES_PREFIX_PATH, which adds them to the package. When one is missing anyway, Qt Creator reports which staged library needs it.

What the application is called on the device

A provisioning profile is issued for one bundle name, and a device installs a package only under that name. Qt Creator therefore uses the name from the profile rather than the one in the project, and reports it when the two differ.

See also How to: Build and Run, How to: Develop for HarmonyOS, Developing for HarmonyOS devices, Sign HarmonyOS packages, and Run on HarmonyOS devices.