This skill builds, installs, launches, and debugs HarmonyOS/OpenHarmony apps by auto-detecting DevEco Studio and configuring tools for you.
npx playbooks add skill openharmonyinsight/openharmony-skills --skill ohos-app-build-debug
Use this skill when the user needs to work with HarmonyOS/OpenHarmony applications:
Build, install, and launch an OHOS application:
# Run scripts from skill directory
python3 $SKILL_DIR/scripts/build.py
python3 $SKILL_DIR/scripts/install.py -f entry/build/default/outputs/default/entry-default-signed.hap
python3 $SKILL_DIR/scripts/launch.py
This skill includes executable scripts in scripts/ that automatically detect DevEco Studio environment:
| Script | Purpose |
|--------|---------|
| build.py | Build OHOS application using hvigorw |
| install.py | Install HAP file to connected device |
| launch.py | Launch installed application |
| screenshot.py | Capture device screenshot |
| parse_crash.py | Parse crash stack using hstack |
| env_detector.py | Detect DevEco Studio and tools |
| ohos_utils.py | Shared utility functions |
For detailed command reference, see [references/command-reference.md](references/command-reference.md).
# 1. Check environment
python3 $SKILL_DIR/scripts/env_detector.py
# 2. Build the application
python3 $SKILL_DIR/scripts/build.py
# 3. Install to device (output from build.py shows HAP path)
python3 $SKILL_DIR/scripts/install.py -f entry/build/default/outputs/default/entry-default-signed.hap
# 4. Launch the app
python3 $SKILL_DIR/scripts/launch.py
python3 $SKILL_DIR/scripts/build.py && \
python3 $SKILL_DIR/scripts/install.py -f $(find entry/build -name "*.hap" | head -1) && \
python3 $SKILL_DIR/scripts/launch.py
# Launch app
python3 $SKILL_DIR/scripts/launch.py
# Take screenshot to verify
python3 $SKILL_DIR/scripts/screenshot.py -o ./screenshots
# Parse crash stack from file
python3 $SKILL_DIR/scripts/parse_crash.py -f crash.txt
# Parse from string
python3 $SKILL_DIR/scripts/parse_crash.py -c "stack trace here"
All scripts automatically detect DevEco Studio installation and configure the environment:
C:\Program Files\Huawei\DevEco Studio\/Applications/DevEco-Studio.app/~/DevEco-Studio/ or /opt/DevEco-Studio/JAVA_HOME to DevEco's bundled JBRPATHHDC_SERVER_PORT=7035When helping users with OHOS development:
$SKILL_DIR with the actual skill installation path~/.claude/skills/ohos-app-build-debug or project-specific pathsscripts/ directory using absolute or relative pathsenv_detector.py when first building to show tool availabilityIf DevEco Studio is not detected:
DEVECO_STUDIO_PATH environment variableIf device is not connected:
For detailed troubleshooting, see [references/troubleshooting.md](references/troubleshooting.md).
Download DevEco Studio: https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/ide-download
Weekly roundup of top Claude Code skills, MCP servers, and AI coding tips.