openharmony-ut

Automate OpenHarmony unit and fuzz test generation, build, deploy, and execution via hdc.

31|6|Updated Jan 29, 2026
One-click install
npx skills add https://github.com/openharmonyinsight/openharmony-skills --skill openharmony-ut
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: openharmony-ut
Source: https://github.com/openharmonyinsight/openharmony-skills/tree/main/skills/openharmony-ut
Command: npx skills add https://github.com/openharmonyinsight/openharmony-skills --skill openharmony-ut

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill automates the end-to-end workflow of OpenHarmony unit testing and fuzz testing so you can generate, build, deploy, and execute tests on real devices without manual, error-prone steps.

Core Features & Use Cases

  • Interactive environment setup: Collects project root, build output path, build command template, and Windows host IP (for hdc connectivity).
  • Device connectivity guardrails: Performs required connectivity validation (ping, hdc port check, target listing, and shell verification) before deploying tests.
  • UT/FuzzTest execution workflow: Supports “only run” (reuse existing artifacts if present) and “write then run” (generate → build → deploy → run → fix loop) flows for OpenHarmony projects.

Use cases:

  • You need to quickly run an existing UT/FuzzTest target on a connected RK device through hdc.
  • You want to modify or create a test and then compile and validate it on-device until it passes.

Quick Start

Tell the assistant: "Run the OpenHarmony UT target <TARGET_NAME> on my RK device using hdc over ${WINDOWS_IP}:8710."

Frequently Asked Questions about openharmony-ut

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run OpenHarmony unit tests on a device using hdc?

To run OpenHarmony unit tests on a device using hdc, you need to provide the project root, build output path, build command, and Windows host IP. The workflow validates hdc connectivity, deploys the artifacts, and executes the specified test target.

What is the workflow for OpenHarmony fuzz testing on real devices?

OpenHarmony fuzz testing on real devices involves generating, compiling, deploying, and executing tests through an automated workflow. It validates device connectivity via hdc port checks and target listing before running the fuzz test targets to ensure reliable execution.

Can I execute existing OpenHarmony test artifacts without recompiling?

Yes, you can execute existing OpenHarmony test artifacts without recompiling by using the "only run" flow. This mode reuses existing build outputs if present, allowing you to quickly deploy and run the specified UT or FuzzTest targets on a connected device.

Do I need to validate hdc connectivity before deploying OpenHarmony tests?

Yes, validating hdc connectivity is required before deploying OpenHarmony tests. The workflow performs connectivity validations including pinging the Windows host IP, checking the hdc port, listing targets, and verifying shell access to ensure reliable device deployment.

How do I regenerate and validate OpenHarmony tests after code changes?

To regenerate and validate OpenHarmony tests after code changes, use the "write then run" flow. This automated loop handles test generation, compilation, deployment, and on-device execution, iterating through fixes until the modified UT or FuzzTest target passes.