Qt for HarmonyOS development with 6.12.0 Beta2: Difference between revisions
add macOS(apple silicon) for 6.12.0 beta2 testing |
mNo edit summary |
||
| Line 1: | Line 1: | ||
With [https://doc-snapshots.qt.io/qt6-6.12/qt-online-installation.html Qt Online Installer], you can install binaries for host platforms via "Desktop" item under "Qt 6.12.0 Beta2", including Windows and macOS. | With [https://doc-snapshots.qt.io/qt6-6.12/qt-online-installation.html Qt Online Installer], you can install binaries for host platforms via "Desktop" item under "Qt 6.12.0 Beta2", including Windows and macOS. | ||
macOS(Apple Silicon) | == macOS(Apple Silicon) == | ||
For examples, you have everything installed at ~/QtSDK. Your host build will be at ~/QtSDK/6.12.0/macos . You can install "HarmonyOS" item under "Qt 6.12.0 Beta2", then you will get it at ~/QtSDK/6.12.0/harmonyos_arm64_v8a . | For examples, you have everything installed at ~/QtSDK. Your host build will be at ~/QtSDK/6.12.0/macos . You can install "HarmonyOS" item under "Qt 6.12.0 Beta2", then you will get it at ~/QtSDK/6.12.0/harmonyos_arm64_v8a . | ||
| Line 9: | Line 9: | ||
Get Additional Packages via https://wiki.qt.io/Building_Qt6_for_HarmonyOS#Additional_Packages , you can put them at .local/opt/ohos/additional-packages . | Get Additional Packages via https://wiki.qt.io/Building_Qt6_for_HarmonyOS#Additional_Packages , you can put them at .local/opt/ohos/additional-packages . | ||
Set SDK path locally(which is from CI setup) | === Set SDK path locally(which is from CI setup) === | ||
<syntaxhighlight lang="shell"> | <syntaxhighlight lang="shell"> | ||
| Line 17: | Line 17: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Trying to build an example | === Trying to build an example === | ||
<syntaxhighlight lang="shell"> | <syntaxhighlight lang="shell"> | ||
| Line 29: | Line 29: | ||
Then you can use DevEco Studio to open the project under ~/QtSDK/Examples/Qt-6.12.0/widgets/gallery/build/libgallery-harmonyos , sign the package, build it and deploy it to device. | Then you can use DevEco Studio to open the project under ~/QtSDK/Examples/Qt-6.12.0/widgets/gallery/build/libgallery-harmonyos , sign the package, build it and deploy it to device. | ||
Reference | |||
* https://wiki.qt.io/Building_Qt6_for_HarmonyOS | |||
Happy Hacking! | Happy Hacking! | ||
Revision as of 16:27, 14 July 2026
With Qt Online Installer, you can install binaries for host platforms via "Desktop" item under "Qt 6.12.0 Beta2", including Windows and macOS.
macOS(Apple Silicon)
For examples, you have everything installed at ~/QtSDK. Your host build will be at ~/QtSDK/6.12.0/macos . You can install "HarmonyOS" item under "Qt 6.12.0 Beta2", then you will get it at ~/QtSDK/6.12.0/harmonyos_arm64_v8a .
For DevEco Studio and SDK, you need to install DevEco Studio 6.1.0 Release(DevEco Studio for Mac(ARM) 6.1.0.860(3.4GB)) via https://developer.huawei.com/consumer/cn/deveco-studio/ . Then you will have SDK with API 23 at /Applications/DevEco-Studio.app/Contents/sdk/default/openharmony .
Get Additional Packages via https://wiki.qt.io/Building_Qt6_for_HarmonyOS#Additional_Packages , you can put them at .local/opt/ohos/additional-packages .
Set SDK path locally(which is from CI setup)
$ sudo mkdir -p /opt/harmonyos/command-line-tools/sdk/default/
$ cd /opt/harmonyos/command-line-tools/sdk/default/
$ sudo ln -s /Applications/DevEco-Studio.app/Contents/sdk/default/openharmony ./openharmonyTrying to build an example
$ cd ~/QtSDK/Examples/Qt-6.12.0/widgets/gallery
$ mkdir build
$ cd build
$ ~/QtSDK/6.12.0/harmonyos_arm64_v8a/bin/qt-cmake -DCMAKE_FIND_ROOT_PATH=~/.local/opt/ohos/additional-packages ..
$ cmake --build . --parallel
$ ~/QtSDK/6.12.0/macos/bin/harmonydeployqt --verbose --hvigor /Applications/DevEco-Studio.app/Contents/tools/hvigor/bin/hvigorw --input ./gallery-harmony-deployment-settings.jsonThen you can use DevEco Studio to open the project under ~/QtSDK/Examples/Qt-6.12.0/widgets/gallery/build/libgallery-harmonyos , sign the package, build it and deploy it to device.
Reference
Happy Hacking!