Building Oniro

Before beginning, ensure that git-lfs and repo are installed. It is recommended to have at least 100GB of free disk space available for the full build.

Obtaining the Source Code

To download the source code, execute the following commands in your terminal:

repo init -u -b OpenHarmony-4.0-Release --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'

Fetching Prebuilt Tools

Once you have the source code run the following script to fetch the prebuilt tools:


Setting Up the Build Environment

For building the project, using an isolated Docker container is recommended for a clean and controlled build environment. Run the following command to start the Docker container:

docker run -it -v $(pwd):/home/openharmony

Configuring and Starting the Build

Inside the Docker instance, set the target device for the build (e.g. rk3568) and use ccache to speed up subsequent builds:

./ --product-name rk3568 --ccache


The flashing procedure is highly hardware specific and can be found in the Developer Boards section for each individual device.

Additional Tips and Troubleshooting

No HDC available in the system

If the hdc tool is not available on your host system, build it using the ohos-sdk:

./ --product-name ohos-sdk --ccache

Find the hdc tool in out/sdk/ohos-sdk/linux/toolchains. To verify the connection with the device, run:

$ hdc list targets

For sending commands to the device:

hdc shell

To read hilog output:

hdc hilog