Oniro App Builder provides a Dockerized tool and a .deb package for building Oniro/OpenHarmony applications.
- Pre-configured environment for Oniro/OpenHarmony ArkTS applications.
- Dockerized solution for consistent builds.
.debpackage for easy installation of tools and SDK setup.onirobuilderexecutable for managing SDK, build, signing, and emulator commands.
Download the latest .deb package from the GitHub Releases page or from the CI workflow artifacts, then install it:
$ sudo dpkg -i onirobuilder.deb
$ sudo apt-get install -fy # Fix missing dependencies if neededRun the following command to install the OpenHarmony SDK, required tools, and Oniro emulator:
$ onirobuilder init- Use
--sdk-version <version>to specify the SDK version (default: 5.0.0). - Use
--no-envto skip modifying your shell profile.
Navigate to your application project and run:
$ onirobuilder buildThe output files will be in the output directory.
To generate the HAP signing certificates and profile, run:
$ onirobuilder signThis updates the build-profile.json5 file with the new signing configs.
The Oniro emulator is installed during onirobuilder init. To start the emulator:
$ onirobuilder emulator [args...]Any extra arguments are passed to the emulator.
Alternatively, you can use the Dockerized environment:
Ensure Docker is installed.
-
Build the Docker image:
$ docker build -t oniro-app-builder . -
Build an application:
$ docker run --rm -v $(pwd):/workspace oniro-app-builder build -
Access the container's shell:
$ docker run --rm -it -v $(pwd):/workspace --entrypoint bash oniro-app-builder
The Dockerfile provides a complete environment for building Oniro/OpenHarmony ArkTS applications:
- Uses
ubuntu:22.04as the base image. - Installs dependencies (
curl,unzip,python3,nodejs, etc.). - Installs the
.debpackage containingonirobuilder. - Runs
onirobuilder initto set up the environment. - Sets
/workspaceas the working directory. - Builds the application and outputs artifacts to the
outputdirectory.
This repository includes a GitHub Actions workflow that automates building, signing, and testing a sample OpenHarmony application using the Oniro build system and emulator.
It consists of two main jobs: build and emulator.
Runs in a Docker container with the Oniro build environment that has already been initialized with onirobuilder init.
Steps:
- Checkout Repository – Retrieves source code.
- Build and Sign App – Uses
onirobuilderto sign and build the app located insample_app. - Upload Build Artifacts – Stores the built app outputs and toolchains as artifacts for later use.
Runs the built app in a headless Oniro emulator to validate functionality.
Steps:
- Download Artifacts – Retrieves the built app and toolchains.
- Start Emulator – Runs QEMU-based Oniro emulator using official images.
- Connect with HDC – Initializes device communication using the
hdcCLI. - Install & Launch App – Installs the signed
.hapfile and launches the entry ability. - Capture Screenshot – Takes a screenshot of the emulator screen via VNC.
- Upload Screenshot – Saves emulator output for inspection.
sample_app_outputs: Compiled and signed.hapapp packageemulator-screenshot: Screenshot of the app running in the emulator
Contributions are welcome! Create a pull request or open an issue for suggestions or issues.
Licensed under Apache License 2.0.