This page contains instructions on how to build your Tuanjie application for OpenHarmony as well as considerations to be aware of when you do. For information on the build process for OpenHarmony and the tools Tuanjie uses, see How Tuanjie builds OpenHarmony applications.
Instead of building your application, you can also export the Tuanjie project as a hvigor project and import that into Deveco studio. This is useful if you want more control over the build pipeline, want to see or modify the OpenHarmony App Module that Tuanjie generates for your application. For more information, see Exporting an OpenHarmony project.
Some digital distribution services have a limit on the initial install size of your application. Tuanjie includes multiple methods that you can use to optimize the install size. For more information, see Optimize distribution size.
If you want to build your application for debugging purposes, application patching can help you reduce the time it takes to build your application. For more information, refer to Application patching.
Before you create a build, configure your project’s settings so that Tuanjie builds the application with the runtime settings and build system properties you want. There are two sets of settings that configure a Tuanjie build:
Tuanjie can build OpenHarmony applications in the following publishing formats:
By default, Tuanjie builds OpenHarmony applications in the Hap publishing format.
To build your Tuanjie application for OpenHarmony:
Tip: After you specify the output path the first time, you can use Ctrl+B (macOS: Cmd+B) keyboard shortcut to build and run the application.
OpenHarmony applications must be digitally signed to run on an OpenHarmony device. There are two types of application signing:
To provide custom signing information, create a keystore and load it into Publishing Settings.
When you provide custom signing information, Tuanjie doesn’t store keystores and key passwords on disk for security reasons. This means that you need to re-enter key passwords each time you restart the Tuanjie Editor. If you don’t provide the passwords and attempt to build the application, the build process fails. To avoid entering passwords each time you open the Tuanjie Editor, it’s best practice to only provide custom signing information when you want to build the application to publish. To create a build for testing on a device, don’t provide custom signing information and use debug signing instead.
For more information about application signing, refer to Sign your hap.