Jump to content

Run qtbase auto tests on HarmonyOS emulator: Difference between revisions

From Qt Wiki
Liang Qi (talk | contribs)
Create "Run qtbase auto tests on HarmonyOS emulator"
 
Liang Qi (talk | contribs)
add linux(arm64) emulator
 
Line 1: Line 1:
= System Setup =
= System Setup =
Host build and Target build steps are same as https://wiki.qt.io/Run_qtbase_auto_tests_on_HarmonyOS_devices .


== macOS(Apple Silicon) ==
== macOS(Apple Silicon) ==
Line 6: Line 8:
* Open a project, Device Manager, Create an emulator, MateBook Pro, HarmonyOS 7.0.0(26.0.0)
* Open a project, Device Manager, Create an emulator, MateBook Pro, HarmonyOS 7.0.0(26.0.0)


Host build and Target build steps are same as https://wiki.qt.io/Run_qtbase_auto_tests_on_HarmonyOS_devices .
Yeah, for running application in HarmonyOS emulator on macOS(Apple Silicon), you still need to sign the package.
 
== Linux(arm64) ==
 
* I am using a MacBook Pro(M1 Pro) with Fedora 44(Asahi Linux)
* https://wiki.qt.io/HarmonyOS_Emulator_on_Linux .
 
With Emulator on Linux(arm64), you don't need to setup QT_HARMONYOS_SIGNING_* things. For the target build, if everything goes well, you will see following:
 
<syntaxhighlight lang="shell">
...
Project location: ~/qt/qtbase-harmonyos-build/harmonyos-tests-bundle
HAP package: ~/qt/qtbase-harmonyos-build/harmonyos-tests-bundle/entry/build/default/outputs/default/entry-default-unsigned.hap
...
</syntaxhighlight>


Yeah, for running application in HarmonyOS emulator on macOS(Apple Silicon), you still need to sign the package.


= Check connection =
= Check connection =

Latest revision as of 17:47, 21 November 2026

System Setup

Host build and Target build steps are same as https://wiki.qt.io/Run_qtbase_auto_tests_on_HarmonyOS_devices .

macOS(Apple Silicon)

  • DevEco Studio 26.0.0.851 installed at /Applications/DevEco-Studio.app
  • Open a project, Device Manager, Create an emulator, MateBook Pro, HarmonyOS 7.0.0(26.0.0)

Yeah, for running application in HarmonyOS emulator on macOS(Apple Silicon), you still need to sign the package.

Linux(arm64)

With Emulator on Linux(arm64), you don't need to setup QT_HARMONYOS_SIGNING_* things. For the target build, if everything goes well, you will see following:

...
Project location: ~/qt/qtbase-harmonyos-build/harmonyos-tests-bundle
HAP package: ~/qt/qtbase-harmonyos-build/harmonyos-tests-bundle/entry/build/default/outputs/default/entry-default-unsigned.hap
...


Check connection

After you run the emulator,

$ /Applications/DevEco-Studio.app/Contents/sdk/default/openharmony/toolchains/hdc list targets
127.0.0.1:5555

Run auto tests

The HarmonyOS Emulator is still not mature enough, for tst_qrhi/tst_qvulkan/tst_qvulkanwidget, the emulator will crash, and even worse on macOS(Apple Silicon), it will also kill the system, then you need a reboot. You'd better to exclude those three tests for a full run.

Let's create a exclude.txt file:

tst_qrhi
tst_qvulkan
tst_qvulkanwidget
$ ctest -j 1 --output-on-failure --no-label-summary --exclude-from-file ./exclude.txt

Happy hacking!