hmos-debug-logs

Diagnose HarmonyOS runtime issues using hilog filtering, hdc commands, and device log capture.

Updated Sep 3, 2026
One-click install
npx skills add https://github.com/YrracOwl/dsh-hmos-sidebar --skill hmos-debug-logs-yrracowl
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hmos-debug-logs
Source: https://github.com/YrracOwl/dsh-hmos-sidebar/tree/main/packages/dsh-hmos-sidebar/presets/native-harmonyos/skills/hmos-debug-logs
Command: npx skills add https://github.com/YrracOwl/dsh-hmos-sidebar --skill hmos-debug-logs-yrracowl

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Debugging HarmonyOS apps at runtime is hard when crashes, white screens, jank, or network failures leave no obvious trace. This Skill provides a structured workflow for capturing and filtering device logs, locating crash stacks, and verifying fixes with evidence instead of guesswork. ## Core Features & Use Cases - hilog Log Mastery: Covers log levels (DEBUG through FATAL), ArkTS hilog printing with public/private formatting, and filtering by tag, regex, or level via hdc shell hilog. - Device Log Capture: Uses dcli__list_devices, dcli__get_device_logs, and dcli__run_app to build, install, launch, and collect logs from real devices and emulators. - Crash & Runtime Triage: Step-by-step flows for locating FATAL/ERROR stacks, mapping ArkTS exception line numbers to src/main/ets source, and diagnosing common causes like null dereferences, missing permissions, and unregistered routes. - Use Case: Your app crashes on launch after a code change. Use this Skill to reinstall via dcli__run_app, filter logs by your app tag and ERROR level, find the ArkTS stack trace, and trace it back to a missing entry in main_pages.json. ## Quick Start Use the hmos-debug-logs skill to capture device logs for my app, filter for FATAL and ERROR entries, and help me locate the crash cause.

Frequently Asked Questions about hmos-debug-logs

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

FAQPage Schema
How do I filter HarmonyOS hilog logs by tag?

Filter hilog output by tag using `hdc shell hilog -T <TAG>`, by content with `-e <regex>`, or by minimum level with `-l E` to show only ERROR and above. Log levels run DEBUG < INFO < WARN < ERROR < FATAL, shown as D/I/W/E/F.

How to capture HarmonyOS device logs for crash analysis?

Use `dcli__get_device_logs` to fetch logs filtered by device, package name, level, or keyword, then isolate FATAL and ERROR entries. ArkTS exception line numbers in the stack map directly to source files under `src/main/ets`.

Why does my HarmonyOS app crash on launch or show a white screen?

Launch crashes usually come from signing issues, misconfigured `abilities` in `module.json5`, or missing entry pages, visible as `Failed to start ability` in logs. White screens typically trace to ArkTS WARN-level exceptions or routes missing from `main_pages.json`.

How do I hide sensitive data in HarmonyOS hilog output?

Use the `%{private}s` format specifier in `hilog.info` calls for sensitive values so they are redacted in log output. Always attach a clear TAG to every log statement so entries remain filterable with `hilog -T`.

What tools diagnose HarmonyOS app jank and memory usage?

Run `hdc shell hilog -T ArkUI -l I` to observe frame statistics and check whether the main thread performs blocking IO or computation. Use `hdc shell dumpsys meminfo <package>` for memory footprint and SmartPerf Host for CPU and memory hotspot analysis.