Setting Up Oniro IDE for Application Development
The Oniro IDE is an essential part of the recommended development environment for Oniro/OpenHarmony application development. Provided as a Visual Studio Code extension, it streamlines the workflow for building, signing, deploying, running, and debugging Oniro apps, as well as managing SDKs and emulators. Oniro IDE serves as an alternative to Dev Eco Studio, offering a lightweight and flexible solution for developers who prefer working within VS Code.
Repository: eclipse-oniro4openharmony/oniro-vscode-ext
Why Use Oniro IDE?
Oniro IDE integrates Oniro/OpenHarmony development tools directly into VS Code, providing:
- A dedicated Oniro sidebar for all major development actions
- One-click build, sign, and deploy workflows
- Emulator management and device deployment
- Integrated log viewer and SDK manager
- Support for Oniro-specific build tasks and debugging
Prerequisites
Before installing Oniro IDE, ensure your system has:
- Node.js (LTS recommended)
- Java SDK (required for building/signing apps)
- QEMU (required for running the Oniro emulator)
All dependencies must be available in your system PATH
.
Installing Oniro IDE
From Marketplace / Open VSX
Install Oniro IDE from:
Steps:
- Open the Extensions view (
Ctrl+Shift+X
). - Search for "Oniro IDE".
- Click Install.
From Source (Development)
Clone and build the extension from the official repository:
git clone https://github.com/eclipse-oniro4openharmony/oniro-vscode-ext.git
cd oniro-ide
npm install
npm run compile
code .
# Press F5 in VS Code to launch the Extension Development Host
Using Oniro IDE in Your Development Workflow
After installation, use the Oniro sidebar or Command Palette (Ctrl+Shift+P
) to access Oniro commands. The typical workflow includes:
- SDK & Tools Setup: Use the SDK Manager to install/update OpenHarmony SDKs, command-line tools, and the Oniro emulator.
- Signature Configs: Generate signing configurations if your app does not have them.
- Build and Sign: Use Oniro commands to build and sign your app.
- Emulator: Start and connect to the Oniro emulator.
- Deploy: Install and launch your
.hap
package on the emulator or device. - Run All: Use the "Run All" command for a full automated flow, including log streaming.
- HiLog Viewer: View logs for your running app.
Oniro IDE Commands
The extension provides the following commands:
oniro-ide.runAll
: Run all steps (emulator, build, install, launch, log viewer)oniro-ide.build
: Build the Oniro apponiro-ide.sign
: Sign the Oniro apponiro-ide.startEmulator
: Start the Oniro emulatoroniro-ide.stopEmulator
: Stop the Oniro emulatoroniro-ide.connectEmulator
: Connect to the running emulatoroniro-ide.installApp
: Install the app on the emulator/deviceoniro-ide.launchApp
: Launch the app on the emulator/deviceoniro-ide.openSdkManager
: Open the Oniro SDK Manageroniro-ide.showHilogViewer
: Open the Oniro HiLog log viewer
Extension Settings
You can configure the following settings in VS Code:
oniro.sdkRootDir
: Root directory for OpenHarmony SDKs (default:${userHome}/setup-ohos-sdk
)oniro.cmdToolsPath
: Directory for OpenHarmony command-line tools (default:${userHome}/command-line-tools
)oniro.emulatorDir
: Directory for Oniro emulator (default:${userHome}/oniro-emulator
)
Platform Support & Issues
- Oniro IDE commands are developed and verified for Linux environments.
- Report issues and feature requests via the GitHub repository.
Recommended launch.json
for Oniro IDE
To enable the F5 shortcut for the Oniro "Run All" workflow, add the following to your .vscode/launch.json
:
{
"version": "0.2.0",
"configurations": [
{
"name": "Oniro: Launch App (with Run All)",
"type": "oniro-debug",
"request": "launch"
}
]
}
This allows you to use F5 or the "Run" button in VS Code to trigger the Oniro "Run All" command for building, deploying, and launching your app.
ArkTS Language Integration
For ArkTS language support, consider the ArkTS VS Code plugin for source code navigation, completion, and linting.