skills/arkweb-app-debug/SKILL.md
Debug HarmonyOS ArkWeb applications using Chrome DevTools Protocol. Use when Claude needs to: (1) Start ArkWeb debugging sessions, (2) Connect Chrome DevTools to HarmonyOS apps via hdc, (3) Inspect webview elements, console, and network, (4) Test ArkWeb applications with Chrome DevTools MCP, (5) Troubleshoot webview debugging issues, or (6) Manage port forwarding and debugging sessions. Automatically detects project configuration, device connection, and debugging sockets. Works with ohos-app-build-debug skill for complete workflow.
npx skillsauth add openharmonyinsight/openharmony-skills arkweb-app-debugInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use this skill when the user needs to debug HarmonyOS ArkWeb (webview) applications:
Start an ArkWeb debugging session:
# Using the debug script (auto-configures environment)
$SKILL_DIR/scripts/start-debug.sh
# Or with explicit package name
$SKILL_DIR/scripts/start-debug.sh --package com.example.app
This skill includes debugging scripts in scripts/:
| Script | Purpose |
|--------|---------|
| start-debug.sh | Start debugging session (macOS/Linux, auto-configures environment) |
| start-debug.py | Start debugging session (cross-platform Python) |
| start-debug.bat | Start debugging session (Windows, auto-configures environment) |
All scripts automatically:
For detailed documentation, see references/.
# Run the debug script from your HarmonyOS project directory
cd /path/to/harmonyos/project
$SKILL_DIR/scripts/start-debug.sh
# The script automatically:
# - Detects project configuration (package name, HAP path)
# - Connects to device
# - Creates port forwarding to webview_devtools socket
# - Opens Chrome DevTools
For complete development workflow:
# 1. Build and install app (using ohos-app-build-debug skill)
$OHOS_SKILL_DIR/scripts/build.py
$OHOS_SKILL_DIR/scripts/install.py -f entry/build/default/outputs/default/entry-default-signed.hap
$OHOS_SKILL_DIR/scripts/launch.py
# 2. Start debugging (this skill)
$SKILL_DIR/scripts/start-debug.sh
When Chrome DevTools MCP is configured, Claude can automatically test webview functionality:
User: Please test the login functionality in my webview
Claude: (Automatically uses Chrome DevTools MCP)
- Opens DevTools connection
- Navigates to login page
- Fills out form
- Submits and verifies results
See references/mcp-guide.md for MCP setup and available tools.
The debug scripts automatically:
AppScope/app.json5Based on real debugging experience:
The scripts handle these timings automatically.
When helping users with ArkWeb debugging:
Check Environment First
hdc list targetssetWebDebuggingAccess(true) in aboutToAppear()Use Scripts
scripts/ directory$SKILL_DIR with actual skill installation path$OHOS_SKILL_DIR with ohos-app-build-debug skill pathHandle Common Issues
hdc fport listCoordinate with ohos-app-build-debug
Show Actual Commands
ArkWeb applications must enable debugging in aboutToAppear():
import { webview } from '@kit.ArkWeb';
@Entry
@Component
struct Index {
controller: webview.WebviewController = new webview.WebviewController();
aboutToAppear() {
// CRITICAL: Enable debugging BEFORE Web component renders
webview.WebviewController.setWebDebuggingAccess(true);
}
build() {
Web({ src: this.currentUrl, controller: this.controller })
}
}
If DevEco Studio/hdc is not detected:
If device is not connected:
If socket is not found:
setWebDebuggingAccess(true) in codehdc shell ps -A | grep <package>For detailed troubleshooting, see references/troubleshooting.md.
setWebDebuggingAccess(true) enabledOptional: Chrome DevTools MCP for AI automated testing
Download DevEco Studio: https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/ide-download
development
Run local code quality checks covering a subset of OpenHarmony gate CI (copyright, CodeArts C/C++) plus additional local checks (pylint/flake8, shellcheck/bashate, gn format). Use before committing to reduce gate failures. Triggers on: /oh-precommit-codecheck, "门禁检查", "门禁预检", "检查代码", "run codecheck", "check code quality", "lint my code", "代码检查", or after completing code implementation. WHEN to use: before git commit, before creating PR, after modifying C/C++/Python/Shell/GN files, when gate CI fails with codecheck defects, or when you want to preview what gate will flag.
development
OpenHarmony PR full lifecycle workflow. Five modes: - Commit: standardized commit with DCO sign-off and Issue linking - Create PR: commit + push to fork + create Issue + create PR on upstream - Fix Codecheck: fetch gate CI codecheck defects from a PR and auto-fix them - Review PR: fetch a PR's changes to local for code review - Fix Review: fetch unresolved review comments from a PR and auto-fix them Triggers on: /oh-pr-workflow, "提交代码", "创建PR", "提个PR", "commit", "修复告警", "修复门禁", "修复codecheck", "fix codecheck", "review pr", "review这个pr", "看下这个pr", "检视pr", "修复review", "修复检视意见", "fix review", or a GitCode PR URL with fix/review intent.
testing
分析 HM Desktop PRD 文档,提取需求信息、验证完整性、检查章节顺序(需求来源→需求背景→需求价值分析→竞品分析→需求描述)、检查 KEP 定义、检测需求冲突并生成结构化分析报告。适用于用户请求:(1) 分析或审查 PRD 文档, (2) 从需求中提取 KEP 列表, (3) 检查 PRD 完整性或一致性, (4) 将需求映射到模块架构, (5) 验证 PRD 格式合规性, (6) 验证竞品分析章节完整性。关键词:PRD分析, requirement extraction, KEP验证, completeness check, chapter order validation, 竞品分析检查, analyze PRD, 需求提取, 完整性检查, 章节顺序验证
development
基于 PRD 文档自动生成鸿蒙系统设计文档,包括架构设计文档和功能设计文档。生成前会分析 OpenHarmony 存量代码结构,确保与现有架构兼容。架构设计文档第2章必须为竞品方案分析,位于需求背景之后。适用于用户请求:(1) 生成架构设计文档, (2) 生成功能设计文档, (3) 从 PRD 生成设计文档, (4) 创建系统架构设计, (5) 编写功能规格说明, (6) 分析 OH 代码结构。关键词:architecture design, functional design, design doc, 竞品方案分析, OpenHarmony code analysis, 架构设计, 功能设计, 设计文档生成, OH代码分析, analyze codebase, competitor analysis