Connect a HarmonyOS Test Device with HDC

Use Huawei’s HDC commands to check a HarmonyOS USB connection, identify the target and select the correct Open-AutoGLM adapter.

Treat the connection as a separate test from model inference. Huawei’s HarmonyOS Device Connector (HDC) can identify a supported device. Open-AutoGLM needs its HDC adapter, a supported screen and a compatible model configuration before it can attempt a task.

Three checks for a HarmonyOS USB test device: authorization, HDC target and adapter selection
Setup diagram based on Huawei’s HDC guide and the upstream Open-AutoGLM README.

Verify the USB connection

  1. Get HDC from the HarmonyOS SDK or command-line tools and make sure your shell can run it.
  2. On a test phone, enable developer mode and USB debugging for your software build. Use a cable that carries data. Accept the debugging prompt on the device if one appears.
  3. Run hdc list targets. For connection status and transport details, run hdc list targets -v. On a connected USB target, identify the row for your test device. When several devices are present, copy its exact target ID for any later command.
SymptomWhat to check next
Shell cannot find hdcOpen the SDK toolchains folder and check the executable path before changing phone settings.
List is emptyRecheck the cable, USB mode, developer options and any host-driver requirements in Huawei’s guide.
Target is offline or unauthorizedCheck the on-device approval prompt. Disconnect and reconnect, then read the status again.
HDC sees the phone but the agent cannotCheck the selected device type and target ID, then check model connectivity separately.

Hand the verified target to the agent

Separate USB and agent failures
  1. Check the USB layer

    Run the SDK’s HDC tool and confirm the handset appears in the target list.

  2. Choose the device type

    Point the runner at HDC and record the target when several devices are attached.

  3. Check the service separately

    If the target is visible but the task cannot run, verify the model endpoint.

The Open-AutoGLM README has separate Android and HarmonyOS steps. Check python main.py --help in your installed revision. The documented HDC example sets --device-type hdc and uses --device-id to select a target. Use the exact ID reported by HDC and the model ID and URL from your chosen provider. The upstream project uses native input methods for HarmonyOS and places ADB Keyboard in the Android instructions.

From the installed project, run python main.py --device-type hdc --list-apps to list the HarmonyOS app entries defined by the project. Check those against the apps and versions available on your test device.

For a first agent check, choose an app you have confirmed is supported on your device. Give one read-only instruction and check the resulting screen manually. Verify screen capture, input, the application and the inference endpoint separately after HDC connects. This setup checklist draws on Huawei’s documentation and the upstream project. Continue with Open-AutoGLM and Midscene on the same HarmonyOS phone, the cross-system comparison or the 中文 HDC 指南.