Install the HarmonyOS Emulator

HarmonyOS mobile exploration uses a local emulator managed by DevEco Studio. UDocs discovers devices through Device Connector (hdc), so in addition to installing DevEco Studio and the HarmonyOS SDK, you also need to ensure that the process that starts UDocs can find hdc.

The recommended configuration is Pura 90 Pro and HarmonyOS 7.0.0(26.0.0). Different DevEco Studio versions may provide different images and device names; use the local emulator actually available on your machine.

1. Install DevEco Studio and the SDK

Download the installer package matching your host system from the DevEco Studio download page.

After installation, open DevEco Studio and install the following in SDK Manager:

  • HarmonyOS SDK
  • Emulator components
  • Device Connector (hdc)

Linux users should first confirm the distributions and version requirements currently supported on the download page.

2. Create and Start a Local Emulator

  1. Open Tools → Device Manager in DevEco Studio.
  2. Download a Phone image.
  3. Use the Local Emulator or Emulator entry to create a local emulator.
  4. Start the emulator and wait for the system to reach the desktop.

This uses a local emulator, not a remote emulator. Pura 90 Pro and HarmonyOS 7.0.0(26.0.0) are recommended; if your machine only provides other runtimes, you can also use the existing configuration.

3. Configure the hdc Environment Variables

macOS

The hdc directory in the default SDK of DevEco Studio is usually:

export HDC_SDK_PATH=/Applications/DevEco-Studio.app/Contents/sdk/default/openharmony/toolchains
export PATH="$PATH:$HDC_SDK_PATH"
hdc list targets

To make this take effect permanently, add the two export lines to ~/.zshrc, then reopen the terminal.

Windows

Use Windows Search to find the directory containing hdc.exe. Add that directory to Path in "System Properties → Environment Variables", reopen Command Prompt, and run:

hdc list targets

The command should list the running emulator. If there is no output, go back to Device Manager in DevEco Studio and confirm that the emulator has started.

4. Restart UDocs and Refresh Detection

After modifying PATH, an already running UDocs process will not automatically receive the new environment variable. You need to:

  1. Completely exit and restart the UDocs service.
  2. Open "Tool Installation" on the left and find "Exploration Tools".
  3. Click "Refresh Detection" and confirm that the HarmonyOS emulator entry can detect hdc.
  4. Open the document creation page of the HarmonyOS project, and for the node select "More Actions → UI Exploration".
  5. You should see the local emulator in the Device ID drop-down list; you can also directly enter the connection identifier shown by hdc list targets.

The mobile emulator is optional and will not block Web project exploration. Only automatic exploration of HarmonyOS projects uses it.

Common Issues

  • Cannot find hdc: Confirm that DevEco Studio and the HarmonyOS SDK are installed, and check whether HDC_SDK_PATH points to an existing toolchains directory.
  • hdc list targets is empty: Confirm that the emulator has started; restart the emulator in Device Manager, then run the command again.
  • UDocs does not discover the device: Confirm that UDocs was started after PATH was set. After modifying environment variables, you must restart UDocs, then click "Refresh Detection".
  • No image is available when creating an emulator: Go back to Device Manager in DevEco Studio to download a Phone image, and confirm that there is sufficient disk space.