Project Setup
Prerequisites
Access to Emulator or to a Device with OpenHarmony OS Installed on it
The emulator is currently available for authorized users only. This project is tested on HarmonyOS NEXT.
HUAWEI ID
HUAWEI ID is needed to sign the app when running on a physical device.
DevEco Studio
- Download the latest (5.0.5.300) DevEco Studio from File Storage repo.
- Unpack all .partX.rar archives.
- Install DevEco Studio.
- Test if the installation was successful by opening and closing DevEco Studio.
NOTE: The SDK version expected by this project can be found in: packages/tester/harmony/build-profile.template.json5::app::products[0]::compatibleSdkVersion.
NPM Setup
DevEco Studio tools require global .npmrc configuration that changes target repository for packages prefixed with @ohos to the Huawei NPM repository.
~/.npmrc
registry=https://repo.huaweicloud.com/repository/npm/
@ohos:registry=https://repo.harmonyos.com/npm/
Install PNPM
Follow official instructions or run npm install -g pnpm@latest-10
Running the tester App for the First Time on a Physical Device
- Set DEVECO_SDK_HOME environment variable (macOS:
/Applications/DevEco-Studio.app/Contents/sdk) - On the project repository page press the "Code" button and copy the URL labelled "Clone with HTTPS".
- Navigate to the directory where you want to store project files in your terminal.
- Run the
git clonecommand to clone the repository (replace the<url>with the copied url of this remote repository). - Navigate to the project directory.
- Run
pnpm init-ws. - Run
pnpm dev. - Open
packages/tester/harmonyproject in DevEco Studio and wait for background jobs to finish. - Connect the device.
- Go to File > Project Structure > Signing Configs and Sign In to generate signature, and then press OK.
- Select 'entry' run configuration (top right corner).
- Press the
Debug 'entry'button (top right corner).