Quick Start
We provide a cli tool to simplify some action. For example: init
, build
and so on.
We will now begin to introduce this capability step by step.
Requirement
Before all, we need to install Rust
and HarmonyOS NDK
.
Rust
For rust, we can use official guide to install it.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
🌈
For more detail about rust, you can visit link
And then we need to install some toolchain and component, which will help use to build prebuild binary for HarmonyOS.
nightly toolchain
OpenHarmony is
tier3
target for rust, so we must use custom toolchain or use source-code to build it. Just run this command and set toolchain tonightly
shellrustup default nightly
rust-std
Then we need to install source code. Just run this command
shellrustup component add rust-src
HarmonyOS NDK
TIP
For the latest SDK Version, You need DevEco Studio NEXT Developer Beta1 (5.0.3.100)
or later.
You just need to download the latest DevEco-Studio
and download the latest SDK. You can download it with official website
Install
Now, you can install cli tool with cargo
.
cargo install ohrs
Simple Project
Using ohrs
to init project
ohrs init hello
And using ohrs
to build project
ohrs build.md