Developing for HarmonyOS devices

How to: Develop for HarmonyOS

Build, deploy, run, and debug applications on HarmonyOS devices.

Qt Creator builds applications for HarmonyOS devices, packages them as a HarmonyOS Ability Package (.hap), signs and installs the package, and runs and debugs the application on the device.

Set the location of the HarmonyOS SDK, and Qt Creator derives the rest from it: the compilers appear as toolchains, connected devices are detected over hdc, and a Qt for HarmonyOS produces a kit of its own.

What you need

  • The HarmonyOS command-line tools, version 6.1 or newer, or an installation of DevEco Studio. The directory to point Qt Creator at is the one that has both sdk and bin in it. The public OpenHarmony SDK is not a substitute: it carries neither hvigor nor the signing tools.
  • A Qt for HarmonyOS. Qt Creator recognizes it by its ohos-clang mkspec.
  • A Java runtime. The SDK signs the package with hap-sign-tool.jar, which needs one.
  • The third-party libraries Qt links against that the device does not carry, such as ICU, fontconfig, freetype, and libpng, built for HarmonyOS and installed under one prefix.
  • Signing material issued for a developer account: a certificate, a provisioning profile, a keystore, and the key alias. A provisioning profile is issued for one bundle name and, for debugging, for particular devices. The device installs a package only under the bundle name of the profile it was signed with.
  • A device with wireless debugging turned on, paired with the computer.

See also How to: Develop for HarmonyOS and How to: Manage kits.