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.
.deb
package for easy installation of tools and SDK setup.onirobuilder
executable 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 needed
Run 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-env
to skip modifying your shell profile.
Navigate to your application project and run:
$ onirobuilder build
The output files will be in the output
directory.
To generate the HAP signing certificates and profile, run:
$ onirobuilder sign
This 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.04
as the base image. - Installs dependencies (
curl
,unzip
,python3
,nodejs
, etc.). - Installs the
.deb
package containingonirobuilder
. - Runs
onirobuilder init
to set up the environment. - Sets
/workspace
as the working directory. - Builds the application and outputs artifacts to the
output
directory.
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
onirobuilder
to 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
hdc
CLI. - Install & Launch App – Installs the signed
.hap
file 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.hap
app 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.