Skip to content

feat: add HarmonyOS platform support#613

Open
wz9527 wants to merge 1 commit into
callstackincubator:mainfrom
wz9527:feat/harmonyos-platform-support
Open

feat: add HarmonyOS platform support#613
wz9527 wants to merge 1 commit into
callstackincubator:mainfrom
wz9527:feat/harmonyos-platform-support

Conversation

@wz9527
Copy link
Copy Markdown

@wz9527 wz9527 commented May 29, 2026

Summary

Add HarmonyOS (鸿蒙) as a first-class platform alongside iOS, Android, macOS, and Linux. This enables agent-device to automate HarmonyOS devices via HDC (HarmonyOS Device Connector).

Platform implementation (src/platforms/harmonyos/, 17 new files)

  • Device management: device discovery via hdc list targets
  • App lifecycle: open, close, app state with automatic launchAbility resolution via wukong appinfo
  • UI snapshot: ArkUI hierarchy parsing with interactive-only filtering (snapshot -i)
  • Input actions: scroll (4 directions), rotate, keyboard dismiss, double-tap, long-press
  • System dialog handling: auto-dismiss privacy policy, notification permission, and update prompts
  • Screen lock: detection and auto-unlock
  • uitest preflight: health checks for stuck uitest processes
  • Clipboard, logcat, perf, recording, screenshot support

Core changes

  • Register harmonyos in backend capabilities, dispatch, interactor, and command schema
  • Add cognition command for UI structure analysis (cross-platform)
  • Extend client types, contracts, and CLI commands for HarmonyOS
  • Update apps command to return structured data with app details
  • 6 new test files for HarmonyOS platform layer

Test plan

  • All 221 test files pass (1827 tests), including 6 new HarmonyOS platform tests
  • pnpm build succeeds
  • No console.log/console.warn debug leftovers (matches existing codebase style)
  • Tested on Huawei Mate 60 Pro (HarmonyOS NEXT) with real apps (小红书, 滴滴)

🤖 Generated with Claude Code

Add HarmonyOS (鸿蒙) as a first-class platform alongside iOS, Android,
macOS, and Linux. This enables agent-device to automate HarmonyOS
devices via HDC (HarmonyOS Device Connector).

Platform implementation (src/platforms/harmonyos/):
- Device discovery and management via HDC
- App lifecycle (open, close, app state) with automatic launchAbility
  resolution via wukong appinfo
- UI snapshot with interactive-only filtering (snapshot -i) for ArkUI
- Screenshot capture
- Input actions: scroll (4 directions), rotate, keyboard dismiss,
  double-tap, long-press
- System dialog auto-dismissal (privacy policy, notification permission,
  update prompts)
- Screen lock detection and auto-unlock
- uitest preflight health checks
- Clipboard, logcat, perf, and recording support

Core changes:
- Register harmonyos in backend capabilities, dispatch, interactor, and
  command schema
- Add cognition map command for UI structure analysis (cross-platform)
- Extend client types, contracts, and CLI commands for HarmonyOS
- Update apps command to return structured data with app details

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@thymikee
Copy link
Copy Markdown
Member

thymikee commented May 29, 2026

nice! can you please rebase to latest main and update accordingly?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants