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
testing
--- name: ohos-req-value-decision description: Use after review meeting to record decision and route to next step. Triggers: 评审决策纪要, 评审结论回流, value decision, 评审接纳, 评审不接纳, 评审退回, 下次重新上会. Do NOT use for feature baseline (ohos-req-feature-baseline), review gate checks (ohos-req-review-gate), or IR generation (ohos-req-feature-to-ir). metadata: author: openharmony scope: common stage: requirements capability: value-decision version: 0.3.0 status: draft tags: - sdd - requirements
development
Use when converting an OpenHarmony requirement document, spec, or design proposal into an OpenHarmony review slide deck (需求评审 / 需求变更评审 / 设计评审 PPTX) — produces the fixed OpenHarmony-branded review-deck structure (OH logo on every page) with architecture/flow diagrams and field tables. Triggers on "需求评审PPT", "需求变更评审", "把需求文档转成评审PPT", "spec转评审PPT", "requirement/spec to review deck". NOT for arbitrary or generic slide decks unrelated to OpenHarmony requirement/design review.
testing
Use when performing the Phase 0 Step 0.5 Review Ready Gate on a 04-feature.md, especially when the user says "evaluate gate", "review readiness", "feature ready?", "should we generate IR", or when the ohos-req-intake-orchestration main session needs a structured Ready / Conditional Ready / Not Ready judgment instead of doing the check inline. Reads 01-04, runs seven fixed checks plus a conditional-items check, and returns a machine-readable JSON summary plus a human-readable table that the main session can route on. Do NOT use for feature baseline generation (ohos-req-feature-baseline), value decision recording (ohos-req-value-decision), or IR generation (ohos-req-feature-to-ir).
testing
--- name: ohos-req-requirement-intake description: Use when importing an OHOS requirement into Phase 0.1, especially for 01-requirement.md, requirement intake, background, user value, scenarios, scope, FR/NFR, affected modules, or priority. Triggers: 需求导入, 01-requirement, 需求基线, RR单号. Do NOT use for feasibility analysis (ohos-req-feasibility-analysis), architecture decision (ohos-req-arch-decision), or feature baseline (ohos-req-feature-baseline). metadata: author: openharmony scope: common