@yinsen/deveco-cli-common 0.0.0-stage → 1.4.0-Test.912
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/NOTICE +12464 -0
- package/README.md +3225 -2
- package/dist/arkts-check.cjs +42 -0
- package/dist/cli.js +1891 -0
- package/dist/design2arkts-engine/LICENSE +21 -0
- package/dist/design2arkts-engine/dist/index.d.ts +2739 -0
- package/dist/design2arkts-engine/dist/index.js +6207 -0
- package/dist/design2arkts-engine/package.json +40 -0
- package/dist/design2arkts-engine/pixso-arkts.mjs +98 -0
- package/dist/design2arkts-engine/resources/skill/LICENSE +21 -0
- package/dist/design2arkts-engine/resources/skill/SKILL.md +249 -0
- package/dist/design2arkts-engine/resources/skill/references/capabilities/hmos-d2a-arkts-logic-completer/INSTRUCTIONS.md +310 -0
- package/dist/design2arkts-engine/resources/skill/references/capabilities/hmos-d2a-arkts-logic-completer/evals/evals.json +249 -0
- package/dist/design2arkts-engine/resources/skill/references/capabilities/hmos-d2a-arkts-logic-completer/references/basics-and-display.md +146 -0
- package/dist/design2arkts-engine/resources/skill/references/capabilities/hmos-d2a-arkts-logic-completer/references/containers-and-navigation.md +527 -0
- package/dist/design2arkts-engine/resources/skill/references/capabilities/hmos-d2a-arkts-logic-completer/references/feedback-and-overlay.md +275 -0
- package/dist/design2arkts-engine/resources/skill/references/capabilities/hmos-d2a-arkts-logic-completer/references/hds-components.md +667 -0
- package/dist/design2arkts-engine/resources/skill/references/capabilities/hmos-d2a-arkts-logic-completer/references/input-and-selection.md +382 -0
- package/dist/design2arkts-engine/resources/skill/references/capabilities/hmos-d2a-arkts-logic-completer/references/patterns/data-and-form.md +440 -0
- package/dist/design2arkts-engine/resources/skill/references/capabilities/hmos-d2a-arkts-logic-completer/references/patterns/state-management.md +213 -0
- package/dist/design2arkts-engine/resources/skill/references/capabilities/hmos-d2a-arkui-scoring-workflow/INSTRUCTIONS.md +189 -0
- package/dist/design2arkts-engine/resources/skill/references/capabilities/hmos-d2a-arkui2hds/INSTRUCTIONS.md +138 -0
- package/dist/design2arkts-engine/resources/skill/references/capabilities/hmos-d2a-arkui2hds/references/components.md +777 -0
- package/dist/design2arkts-engine/resources/skill/references/capabilities/hmos-d2a-arkui2hds/references/migration-patterns.md +187 -0
- package/dist/design2arkts-engine/resources/skill/references/capabilities/hmos-d2a-react-to-arkui/INSTRUCTIONS.md +352 -0
- package/dist/design2arkts-engine/resources/skill/references/capabilities/hmos-d2a-react-to-arkui/references/arkui-basic-mapping.md +455 -0
- package/dist/design2arkts-engine/resources/skill/references/capabilities/hmos-d2a-react-to-arkui/references/arkui-common-issues.md +516 -0
- package/dist/design2arkts-engine/resources/skill/references/capabilities/hmos-d2a-react-to-arkui/references/arkui-knowledge-base/api-cards/button.md +104 -0
- package/dist/design2arkts-engine/resources/skill/references/capabilities/hmos-d2a-react-to-arkui/references/arkui-knowledge-base/api-cards/flex.md +115 -0
- package/dist/design2arkts-engine/resources/skill/references/capabilities/hmos-d2a-react-to-arkui/references/arkui-knowledge-base/api-cards/grid.md +121 -0
- package/dist/design2arkts-engine/resources/skill/references/capabilities/hmos-d2a-react-to-arkui/references/arkui-knowledge-base/api-cards/image.md +118 -0
- package/dist/design2arkts-engine/resources/skill/references/capabilities/hmos-d2a-react-to-arkui/references/arkui-knowledge-base/api-cards/list.md +152 -0
- package/dist/design2arkts-engine/resources/skill/references/capabilities/hmos-d2a-react-to-arkui/references/arkui-knowledge-base/api-cards/location.md +160 -0
- package/dist/design2arkts-engine/resources/skill/references/capabilities/hmos-d2a-react-to-arkui/references/arkui-knowledge-base/api-cards/richeditor.md +132 -0
- package/dist/design2arkts-engine/resources/skill/references/capabilities/hmos-d2a-react-to-arkui/references/arkui-knowledge-base/api-cards/row-column.md +118 -0
- package/dist/design2arkts-engine/resources/skill/references/capabilities/hmos-d2a-react-to-arkui/references/arkui-knowledge-base/api-cards/stack.md +106 -0
- package/dist/design2arkts-engine/resources/skill/references/capabilities/hmos-d2a-react-to-arkui/references/arkui-knowledge-base/api-cards/swiper.md +117 -0
- package/dist/design2arkts-engine/resources/skill/references/capabilities/hmos-d2a-react-to-arkui/references/arkui-knowledge-base/api-cards/tabs.md +163 -0
- package/dist/design2arkts-engine/resources/skill/references/capabilities/hmos-d2a-react-to-arkui/references/arkui-knowledge-base/api-cards/text-input.md +147 -0
- package/dist/design2arkts-engine/resources/skill/references/capabilities/hmos-d2a-react-to-arkui/references/arkui-knowledge-base/api-cards/text.md +145 -0
- package/dist/design2arkts-engine/resources/skill/references/capabilities/hmos-d2a-react-to-arkui/references/arkui-knowledge-base/api-cards/waterflow.md +116 -0
- package/dist/design2arkts-engine/resources/skill/references/capabilities/hmos-d2a-react-to-arkui/references/arkui-knowledge-base/index.md +23 -0
- package/dist/design2arkts-engine/resources/skill/references/capabilities/hmos-d2a-react-to-arkui/references/arkui-knowledge-base/matching.md +127 -0
- package/dist/design2arkts-engine/resources/skill/references/capabilities/hmos-d2a-react-to-arkui/references/clarification-template.md +53 -0
- package/dist/design2arkts-engine/resources/skill/references/capabilities/hmos-d2a-repo-understand/INSTRUCTIONS.md +163 -0
- package/dist/design2arkts-engine/resources/skill/references/capabilities/hmos-d2a-repo-understand/references/architecture-patterns/api-architecture.md +17 -0
- package/dist/design2arkts-engine/resources/skill/references/capabilities/hmos-d2a-repo-understand/references/architecture-patterns/data-architecture.md +17 -0
- package/dist/design2arkts-engine/resources/skill/references/capabilities/hmos-d2a-repo-understand/references/architecture-patterns/logic-architecture.md +17 -0
- package/dist/design2arkts-engine/resources/skill/references/capabilities/hmos-d2a-repo-understand/references/architecture-patterns/ui-architecture.md +23 -0
- package/dist/design2arkts-engine/resources/skill/references/capabilities/hmos-d2a-repo-understand/references/methodology/behavior-audit.md +143 -0
- package/dist/design2arkts-engine/resources/skill/references/capabilities/hmos-d2a-repo-understand/references/methodology/diff-analysis.md +115 -0
- package/dist/design2arkts-engine/resources/skill/references/capabilities/hmos-d2a-repo-understand/references/methodology/dimension-identification.md +86 -0
- package/dist/design2arkts-engine/resources/skill/references/capabilities/hmos-d2a-repo-understand/references/methodology/output-format.md +347 -0
- package/dist/design2arkts-engine/resources/skill/references/capabilities/hmos-d2a-repo-understand/references/methodology/understanding-modes.md +214 -0
- package/dist/design2arkts-engine/resources/skill/references/capabilities/hmos-d2a-responsive-layout-generator/INSTRUCTIONS.md +86 -0
- package/dist/design2arkts-engine/resources/skill/references/capabilities/hmos-d2a-responsive-layout-generator/references/breakpoints.md +86 -0
- package/dist/design2arkts-engine/resources/skill/references/capabilities/hmos-d2a-responsive-layout-generator/references/chunks.md +48 -0
- package/dist/design2arkts-engine/resources/skill/references/capabilities/hmos-d2a-responsive-layout-generator/references/dsl-schema.md +151 -0
- package/dist/design2arkts-engine/resources/skill/references/capabilities/hmos-d2a-responsive-layout-generator/references/patterns.md +147 -0
- package/dist/design2arkts-engine/resources/skill/references/capabilities/hmos-d2a-responsive-layout-generator/references/rules.md +115 -0
- package/dist/design2arkts-engine/resources/skill/references/capabilities/hmos-d2a-solution-design/INSTRUCTIONS.md +572 -0
- package/dist/design2arkts-engine/resources/skill/references/capabilities/hmos-d2a-solution-design/assets/template-ui-page.md +293 -0
- package/dist/design2arkts-engine/resources/skill/references/capabilities/hmos-d2a-solution-design/references/animation-design.md +84 -0
- package/dist/design2arkts-engine/resources/skill/references/capabilities/hmos-d2a-ui-reconstruction-score/INSTRUCTIONS.md +195 -0
- package/dist/design2arkts-engine/resources/skill/references/capabilities/hmos-d2a-ui-reconstruction-score/references/analysis_workflow.md +119 -0
- package/dist/design2arkts-engine/resources/skill/references/capabilities/hmos-d2a-ui-reconstruction-score/references/scoring_schema.md +83 -0
- package/dist/design2arkts-engine/resources/skill/references/capabilities/hmos-d2a-ui-reconstruction-score/references/vlm_prompt.md +61 -0
- package/dist/design2arkts-engine/resources/skill/references/capabilities/hmos-d2a-ui-reconstruction-score/scripts/ui_score.py +691 -0
- package/dist/design2arkts-engine/resources/skill/references/cli-integration.md +119 -0
- package/dist/design2arkts-engine/resources/skill/references/design-doc-auto-recovery.md +91 -0
- package/dist/design2arkts-engine/resources/skill/references/figma/fast/stages/01-acquire-figma-react-source.md +96 -0
- package/dist/design2arkts-engine/resources/skill/references/figma/fast/stages/02-convert-react-to-arkui.md +94 -0
- package/dist/design2arkts-engine/resources/skill/references/figma/fast/stages/03-complete-interaction-logic.md +26 -0
- package/dist/design2arkts-engine/resources/skill/references/figma/fast/stages/04-quality-and-build.md +45 -0
- package/dist/design2arkts-engine/resources/skill/references/figma/fast/stages/05-summary.md +44 -0
- package/dist/design2arkts-engine/resources/skill/references/figma/full/stages/01-acquire-figma-react-source.md +161 -0
- package/dist/design2arkts-engine/resources/skill/references/figma/full/stages/02-convert-react-to-arkui.md +221 -0
- package/dist/design2arkts-engine/resources/skill/references/figma/full/stages/03-complete-interaction-logic.md +31 -0
- package/dist/design2arkts-engine/resources/skill/references/figma/full/stages/04-quality-and-build.md +30 -0
- package/dist/design2arkts-engine/resources/skill/references/figma/full/stages/05-visual-calibration.md +193 -0
- package/dist/design2arkts-engine/resources/skill/references/figma/full/stages/06-summary.md +41 -0
- package/dist/design2arkts-engine/resources/skill/references/figma/stage-catalog-fast.json +40 -0
- package/dist/design2arkts-engine/resources/skill/references/figma/stage-catalog-full.json +47 -0
- package/dist/design2arkts-engine/resources/skill/references/host-vision.md +56 -0
- package/dist/design2arkts-engine/resources/skill/references/mcp-dependency.md +62 -0
- package/dist/design2arkts-engine/resources/skill/references/page-revisions.md +42 -0
- package/dist/design2arkts-engine/resources/skill/references/pixso/fast/stages/01-acquire-pixso-dsl.md +287 -0
- package/dist/design2arkts-engine/resources/skill/references/pixso/fast/stages/02-generate-skeleton-and-assets.md +247 -0
- package/dist/design2arkts-engine/resources/skill/references/pixso/fast/stages/03-understand-repository.md +133 -0
- package/dist/design2arkts-engine/resources/skill/references/pixso/fast/stages/05-design-component-tree.md +222 -0
- package/dist/design2arkts-engine/resources/skill/references/pixso/fast/stages/06-implement-static-layout.md +143 -0
- package/dist/design2arkts-engine/resources/skill/references/pixso/fast/stages/07-complete-interaction-logic.md +131 -0
- package/dist/design2arkts-engine/resources/skill/references/pixso/fast/stages/08-quality-build-and-audits.md +345 -0
- package/dist/design2arkts-engine/resources/skill/references/pixso/fast/stages/09-summary.md +113 -0
- package/dist/design2arkts-engine/resources/skill/references/pixso/full/stages/01-acquire-pixso-dsl.md +287 -0
- package/dist/design2arkts-engine/resources/skill/references/pixso/full/stages/02-generate-skeleton-and-assets.md +247 -0
- package/dist/design2arkts-engine/resources/skill/references/pixso/full/stages/03-understand-repository.md +133 -0
- package/dist/design2arkts-engine/resources/skill/references/pixso/full/stages/05-design-and-confirm-component-tree.md +282 -0
- package/dist/design2arkts-engine/resources/skill/references/pixso/full/stages/06-implement-static-layout.md +143 -0
- package/dist/design2arkts-engine/resources/skill/references/pixso/full/stages/07-complete-interaction-logic.md +131 -0
- package/dist/design2arkts-engine/resources/skill/references/pixso/full/stages/08-quality-build-and-audits.md +345 -0
- package/dist/design2arkts-engine/resources/skill/references/pixso/full/stages/09-visual-calibration.md +193 -0
- package/dist/design2arkts-engine/resources/skill/references/pixso/full/stages/10-summary.md +125 -0
- package/dist/design2arkts-engine/resources/skill/references/pixso/stage-catalog-fast.json +58 -0
- package/dist/design2arkts-engine/resources/skill/references/pixso/stage-catalog-full.json +64 -0
- package/dist/design2arkts-engine/resources/skill/references/requirement-clarification.md +131 -0
- package/dist/design2arkts-engine/resources/skill/references/resource-revisions.md +13 -0
- package/dist/design2arkts-engine/resources/skill/references/runtime-contract.md +444 -0
- package/dist/design2arkts-engine/resources/skill/references/score-engine.json +5 -0
- package/dist/design2arkts-engine/resources/skill/references/source-tools.md +17 -0
- package/dist/design2arkts-engine/resources/skill/references/standalone-capabilities.md +63 -0
- package/dist/design2arkts-engine/resources/skill/references/workflow-origin.json +96 -0
- package/dist/design2arkts-engine/resources/skill/scripts/file-lock.mjs +131 -0
- package/dist/design2arkts-engine/resources/skill/scripts/workflow.mjs +4129 -0
- package/dist/design2arkts-engine/runner.mjs +44 -0
- package/dist/internal/plugin-hook-runner.js +1 -0
- package/dist/internal/telemetry-upload-background.js +46 -0
- package/package.json +91 -4
- package/skills/deveco-cli/SKILL.md +582 -0
- package/skills/deveco-cli/docs/arkts-rules.md +33 -0
- package/skills/deveco-cli/docs/design2arkts.md +276 -0
- package/skills/hmos-arkui-develop-skill/SKILL.md +77 -0
- package/skills/hmos-arkui-develop-skill/references/quick-apis/01-layout.md +634 -0
- package/skills/hmos-arkui-develop-skill/references/quick-apis/02-basic-components.md +649 -0
- package/skills/hmos-arkui-develop-skill/references/quick-apis/03-data-display.md +81 -0
- package/skills/hmos-arkui-develop-skill/references/quick-apis/04-selectors.md +109 -0
- package/skills/hmos-arkui-develop-skill/references/quick-apis/05-media.md +90 -0
- package/skills/hmos-arkui-develop-skill/references/quick-apis/06-advanced.md +32 -0
- package/skills/hmos-arkui-develop-skill/references/quick-apis/07-security.md +30 -0
- package/skills/hmos-arkui-develop-skill/references/quick-apis/08-state-decorators.md +120 -0
- package/skills/hmos-arkui-develop-skill/references/quick-apis/09-animation.md +118 -0
- package/skills/hmos-arkui-develop-skill/references/quick-apis/10-gesture.md +89 -0
- package/skills/hmos-arkui-develop-skill/references/quick-apis/11-dialog-menu.md +152 -0
- package/skills/hmos-arkui-develop-skill/references/quick-apis/12-navigation.md +127 -0
- package/skills/hmos-arkui-develop-skill/references/quick-apis/13-rendering.md +52 -0
- package/skills/hmos-arkui-develop-skill/references/quick-apis/14-extension.md +22 -0
- package/skills/hmos-arkui-develop-skill/references/quick-apis/15-theme-style.md +10 -0
- package/skills/hmos-arkui-develop-skill/references/quick-apis/16-enums.md +128 -0
- package/skills/hmos-arkui-develop-skill/references/quick-apis/17-resources.md +401 -0
- package/skills/hmos-arkui-develop-skill/references/quick-apis/18-error-code.md +24 -0
- package/skills/hmos-arkui-develop-skill/references/quick-apis/_index.md +76 -0
- package/skills/hmos-arkui-develop-skill/references/quick-rules/00-arkts-syntax.md +229 -0
- package/skills/hmos-arkui-develop-skill/references/quick-rules/01-import.md +116 -0
- package/skills/hmos-arkui-develop-skill/references/quick-rules/02-uicontext.md +56 -0
- package/skills/hmos-arkui-develop-skill/references/quick-rules/03-component.md +105 -0
- package/skills/hmos-arkui-develop-skill/references/quick-rules/04-build.md +41 -0
- package/skills/hmos-arkui-develop-skill/references/quick-rules/05-state.md +300 -0
- package/skills/hmos-arkui-develop-skill/references/quick-rules/06-rendering.md +67 -0
- package/skills/hmos-arkui-develop-skill/references/quick-rules/07-attribute-params.md +219 -0
- package/skills/hmos-arkui-develop-skill/references/quick-rules/08-navigation.md +102 -0
- package/skills/hmos-arkui-develop-skill/references/quick-rules/09-dialog.md +72 -0
- package/skills/hmos-arkui-develop-skill/references/quick-rules/10-style.md +90 -0
- package/skills/hmos-arkui-develop-skill/references/quick-rules/11-extension.md +54 -0
- package/skills/hmos-arkui-develop-skill/references/quick-rules/12-layout.md +69 -0
- package/skills/hmos-arkui-develop-skill/references/quick-rules/13-performance.md +27 -0
- package/skills/hmos-arkui-develop-skill/references/quick-rules/14-deprecated.md +28 -0
- package/skills/hmos-arkui-develop-skill/references/quick-rules/_index.md +79 -0
- package/skills/hmos-arkui-develop-skill/references/style-guide.md +491 -0
- package/skills/hmos-arkui-develop-skill/test-cases/code_gen_cases.json +292 -0
- package/skills/hmos-dfx-analyzer/SKILL.md +717 -0
- package/skills/hmos-dfx-analyzer/changelog/CHANGELOG.md +17 -0
- package/skills/hmos-dfx-analyzer/evals/evals.json +119 -0
- package/skills/hmos-dfx-analyzer/references/appfreeze/analyzer.md +471 -0
- package/skills/hmos-dfx-analyzer/references/appfreeze/references/fault-mode-library.md +94 -0
- package/skills/hmos-dfx-analyzer/references/appfreeze/references/ffrt-freeze-analysis.md +132 -0
- package/skills/hmos-dfx-analyzer/references/appfreeze/references/libuv-freeze-analysis.md +116 -0
- package/skills/hmos-dfx-analyzer/references/appfreeze/scripts/freeze/__init__.py +40 -0
- package/skills/hmos-dfx-analyzer/references/appfreeze/scripts/freeze/binder.py +343 -0
- package/skills/hmos-dfx-analyzer/references/appfreeze/scripts/freeze/collector.py +84 -0
- package/skills/hmos-dfx-analyzer/references/appfreeze/scripts/freeze/common.py +132 -0
- package/skills/hmos-dfx-analyzer/references/appfreeze/scripts/freeze/faultlog.py +212 -0
- package/skills/hmos-dfx-analyzer/references/appfreeze/scripts/freeze/main.py +81 -0
- package/skills/hmos-dfx-analyzer/references/appfreeze/scripts/freeze/report.py +675 -0
- package/skills/hmos-dfx-analyzer/references/appfreeze/scripts/freeze/sections.py +377 -0
- package/skills/hmos-dfx-analyzer/references/appfreeze/scripts/freeze/stack.py +165 -0
- package/skills/hmos-dfx-analyzer/references/appfreeze/scripts/llvm_addr2line.py +123 -0
- package/skills/hmos-dfx-analyzer/references/appfreeze/scripts/match_so.py +120 -0
- package/skills/hmos-dfx-analyzer/references/appfreeze/scripts/sample_stack_analyzer.py +209 -0
- package/skills/hmos-dfx-analyzer/references/cppcrash/analyzer.md +470 -0
- package/skills/hmos-dfx-analyzer/references/cppcrash/references/arkdata.md +325 -0
- package/skills/hmos-dfx-analyzer/references/cppcrash/references/arkui.md +266 -0
- package/skills/hmos-dfx-analyzer/references/cppcrash/references/arkweb.md +144 -0
- package/skills/hmos-dfx-analyzer/references/cppcrash/references/fault_mode.md +178 -0
- package/skills/hmos-dfx-analyzer/references/cppcrash/references/gwp_asan.md +300 -0
- package/skills/hmos-dfx-analyzer/references/cppcrash/references/jsruntime.md +339 -0
- package/skills/hmos-dfx-analyzer/references/cppcrash/references/jsvm.md +203 -0
- package/skills/hmos-dfx-analyzer/references/cppcrash/references/libuv.md +166 -0
- package/skills/hmos-dfx-analyzer/references/cppcrash/references/memory_corruption.md +348 -0
- package/skills/hmos-dfx-analyzer/references/cppcrash/references/memory_corruption_second_scene.md +74 -0
- package/skills/hmos-dfx-analyzer/references/cppcrash/references/multithreading.md +284 -0
- package/skills/hmos-dfx-analyzer/references/cppcrash/references/render_service.md +300 -0
- package/skills/hmos-dfx-analyzer/references/cppcrash/references/rosen_text.md +41 -0
- package/skills/hmos-dfx-analyzer/references/cppcrash/scripts/__init__.py +36 -0
- package/skills/hmos-dfx-analyzer/references/cppcrash/scripts/collector.py +93 -0
- package/skills/hmos-dfx-analyzer/references/cppcrash/scripts/common.py +68 -0
- package/skills/hmos-dfx-analyzer/references/cppcrash/scripts/crash_log.py +275 -0
- package/skills/hmos-dfx-analyzer/references/cppcrash/scripts/extract_hilog.py +69 -0
- package/skills/hmos-dfx-analyzer/references/cppcrash/scripts/hints.py +251 -0
- package/skills/hmos-dfx-analyzer/references/cppcrash/scripts/main.py +82 -0
- package/skills/hmos-dfx-analyzer/references/cppcrash/scripts/match_so.py +120 -0
- package/skills/hmos-dfx-analyzer/references/cppcrash/scripts/ohos_llvm_tools.py +279 -0
- package/skills/hmos-dfx-analyzer/references/cppcrash/scripts/report.py +226 -0
- package/skills/hmos-dfx-analyzer/references/jscrash/analyzer.md +174 -0
- package/skills/hmos-dfx-analyzer/references/jscrash/references/fault-mode-library.md +107 -0
- package/skills/hmos-dfx-analyzer/references/jscrash/references/jscrash-patterns.md +92 -0
- package/skills/hmos-dfx-analyzer/references/jscrash/references/sourcemap-symbolication.md +67 -0
- package/skills/hmos-dfx-analyzer/references/jscrash/scripts/hstack/bin/hstack +25 -0
- package/skills/hmos-dfx-analyzer/references/jscrash/scripts/hstack/bin/hstack.bat +26 -0
- package/skills/hmos-dfx-analyzer/references/jscrash/scripts/hstack/lib/index.js +2 -0
- package/skills/hmos-dfx-analyzer/references/jscrash/scripts/hstack/lib/index.js.LICENSE.txt +1 -0
- package/skills/hmos-dfx-analyzer/references/jscrash/scripts/hstack/lib/mappings.wasm +0 -0
- package/skills/hmos-dfx-analyzer/references/report-encoding-pitfalls.md +41 -0
- package/skills/hmos-dfx-analyzer/references/white-screen/analyzer.md +129 -0
- package/skills/hmos-dfx-analyzer/scripts/collect/collect-hilog.mjs +120 -0
- package/skills/hmos-dfx-analyzer/scripts/collect/jscrash-report.mjs +138 -0
- package/skills/hmos-dfx-analyzer/scripts/collect/parse-jscrash-log.mjs +126 -0
- package/skills/hmos-dfx-analyzer/scripts/collect/shared/deveco-cli.mjs +79 -0
- package/skills/hmos-dfx-analyzer/scripts/collect/shared/jscrash-parse.mjs +389 -0
- package/skills/hmos-dfx-analyzer/scripts/collect/shared/utils.mjs +27 -0
- package/skills/hmos-dfx-analyzer/scripts/export_report.py +379 -0
- package/skills/hmos-dfx-analyzer/scripts/identify_fault_log.py +500 -0
- package/skills/hmos-dfx-analyzer/scripts/report_template.html +103 -0
- package/skills/hmos-dfx-analyzer/test-cases/functional.md +160 -0
- package/skills/hmos-dfx-analyzer/test-cases/smoke.md +123 -0
- package/skills/hmos-dfx-analyzer/test-cases/test-prompts.md +35 -0
- package/skills/hmos-dfx-analyzer/test-cases/trigger.md +140 -0
- package/skills/index.json +17 -0
- package/src/resources/aclPermission/aclPermissionsInfo.json +311 -0
- package/src/resources/agents/arkts-architect.yaml +14 -0
- package/src/resources/agents/arkts-developer.yaml +18 -0
- package/src/resources/agents/arkts-judge.yaml +12 -0
- package/src/resources/agents/arkts-reviewer.yaml +14 -0
- package/src/resources/agents/code-hunter.yaml +14 -0
- package/src/resources/agents/code-judge.yaml +13 -0
- package/src/resources/agents/developer.yaml +15 -0
- package/src/resources/agents/documentation-writer.yaml +14 -0
- package/src/resources/agents/workflow-decider.yaml +14 -0
- package/src/resources/engines/claude.yaml +43 -0
- package/src/resources/engines/codex.yaml +38 -0
- package/src/resources/engines/opencode.yaml +54 -0
- package/src/resources/workflows/.gitkeep +0 -0
- package/templates/application/AppScope/app.json5 +10 -0
- package/templates/application/AppScope/resources/base/element/string.json +8 -0
- package/templates/application/AppScope/resources/base/media/layered_image.json +7 -0
- package/templates/application/build-profile.json5 +42 -0
- package/templates/application/code-linter.json5 +32 -0
- package/templates/application/entry/build-profile.json5 +33 -0
- package/templates/application/entry/gitignore.txt +6 -0
- package/templates/application/entry/hvigorfile.ts +7 -0
- package/templates/application/entry/obfuscation-rules.txt +20 -0
- package/templates/application/entry/oh-package.json5 +10 -0
- package/templates/application/entry/src/main/ets/entryability/EntryAbility.ets +63 -0
- package/templates/application/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +31 -0
- package/templates/application/entry/src/main/ets/pages/Index.ets +38 -0
- package/templates/application/entry/src/main/module.json5 +50 -0
- package/templates/application/entry/src/main/resources/base/element/color.json +8 -0
- package/templates/application/entry/src/main/resources/base/element/float.json +8 -0
- package/templates/application/entry/src/main/resources/base/element/string.json +16 -0
- package/templates/application/entry/src/main/resources/base/media/layered_image.json +7 -0
- package/templates/application/entry/src/main/resources/base/profile/backup_config.json +3 -0
- package/templates/application/entry/src/main/resources/base/profile/main_pages.json +5 -0
- package/templates/application/entry/src/main/resources/dark/element/color.json +8 -0
- package/templates/application/gitignore.txt +13 -0
- package/templates/application/hvigor/hvigor-config.json5 +23 -0
- package/templates/application/hvigorfile.ts +7 -0
- package/templates/application/oh-package.json5 +10 -0
- package/templates/application/template.json +8 -0
- package/templates/native-cpp/AppScope/app.json5 +10 -0
- package/templates/native-cpp/AppScope/resources/base/element/string.json +8 -0
- package/templates/native-cpp/AppScope/resources/base/media/layered_image.json +7 -0
- package/templates/native-cpp/build-profile.json5 +43 -0
- package/templates/native-cpp/code-linter.json5 +32 -0
- package/templates/native-cpp/entry/build-profile.json5 +48 -0
- package/templates/native-cpp/entry/gitignore.txt +6 -0
- package/templates/native-cpp/entry/hvigorfile.ts +6 -0
- package/templates/native-cpp/entry/obfuscation-rules.txt +20 -0
- package/templates/native-cpp/entry/oh-package.json5 +11 -0
- package/templates/native-cpp/entry/src/main/cpp/CMakeLists.txt +15 -0
- package/templates/native-cpp/entry/src/main/cpp/napi_init.cpp +67 -0
- package/templates/native-cpp/entry/src/main/cpp/types/libentry/Index.d.ts +16 -0
- package/templates/native-cpp/entry/src/main/cpp/types/libentry/oh-package.json5 +6 -0
- package/templates/native-cpp/entry/src/main/ets/entryability/EntryAbility.ets +63 -0
- package/templates/native-cpp/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +31 -0
- package/templates/native-cpp/entry/src/main/ets/pages/Index.ets +26 -0
- package/templates/native-cpp/entry/src/main/module.json5 +50 -0
- package/templates/native-cpp/entry/src/main/resources/base/element/color.json +8 -0
- package/templates/native-cpp/entry/src/main/resources/base/element/float.json +8 -0
- package/templates/native-cpp/entry/src/main/resources/base/element/string.json +16 -0
- package/templates/native-cpp/entry/src/main/resources/base/media/layered_image.json +7 -0
- package/templates/native-cpp/entry/src/main/resources/base/profile/backup_config.json +3 -0
- package/templates/native-cpp/entry/src/main/resources/base/profile/main_pages.json +5 -0
- package/templates/native-cpp/entry/src/main/resources/dark/element/color.json +8 -0
- package/templates/native-cpp/gitignore.txt +13 -0
- package/templates/native-cpp/hvigor/hvigor-config.json5 +23 -0
- package/templates/native-cpp/hvigorfile.ts +6 -0
- package/templates/native-cpp/oh-package.json5 +10 -0
- package/templates/native-cpp/template.json +8 -0
|
@@ -0,0 +1,582 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: deveco-cli
|
|
3
|
+
description: >-
|
|
4
|
+
Use 'devecocli' for HarmonyOS apps (scaffold, build, run, debug, devices, emulators, logs, docs, UI inspection, 鸿蒙开发文档, skills), including generating ArkUI pages from Pixso/Figma designs (设计稿还原). Use it if workspace has build-profile.json5 or oh-package.json5, or user mentions HarmonyOS, 鸿蒙, DevEco, ArkTS, ArkUI, docs, 鸿蒙文档, 知识, 搜索, skills, UI, UI测试, 组件调试, 预览器(HarmonyOS PC), 多设备预览器(HarmonyOS PC), 预览器截图, 视觉走查, 截图验证, workflow, 工作流. If user explicitly specifies another tool, skill, or workflow, follow that choice; otherwise use 'devecocli'.
|
|
5
|
+
Also covers on-device testing services: 测试, 检测, 内存泄漏, 稳定性, 性能, 功耗, 兼容性, DevEco Testing. When asked to test an app on a device (性能测试 / 内存泄漏 / 稳定性 / UX / 上架预检 — performance, memory leak, stability, UX, app-store precheck), run 'devecocli testing' instead of hand-rolling hdc, bm dump or SP_daemon commands.
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# DevEco CLI
|
|
9
|
+
|
|
10
|
+
`devecocli` wraps DevEco Studio's `hvigor`, `ohpm`, `hdc`, emulator toolchain, and bundled skills installer.
|
|
11
|
+
|
|
12
|
+
Available commands: `build`, `check`, `run`, `debug`, `update`, `device`, `emulator`, `ui`, `skills`, `plugin`, `log`, `verify`, `profiler`, `create`, `init`, `serve`, `docs`, `signature`, `auth`, `design2arkts` (alias `d2a`), `testing`, `workflow`.
|
|
13
|
+
|
|
14
|
+
**Sandbox Rule**: Commands tagged `[Outside sandbox]` must be run outside the sandbox.
|
|
15
|
+
|
|
16
|
+
**Output streams**: Results go to stdout. Debug logs (`DEVECO_CLI_DEBUG=1`), progress, warnings, errors, and upgrade notices go to stderr; use the exit code to determine success. Commands supporting console JSON keep stdout to one JSON value with `--format json`.
|
|
17
|
+
|
|
18
|
+
## 1. Code → Build → Deploy → Run → Debug
|
|
19
|
+
|
|
20
|
+
### `devecocli create`
|
|
21
|
+
Scaffold a new HarmonyOS project. Built-in templates: `empty-ability` (default) and `native-cpp` (C++/NAPI); run `create list` to see all.
|
|
22
|
+
- `--app-name <name>` (Req): 1–200 chars, `^[a-zA-Z][a-zA-Z0-9_]*$`
|
|
23
|
+
- `--project-path <path>`: Auto-created if omitted (`./<app-name>`). Must be empty if exists.
|
|
24
|
+
- `--bundle-name <bundle>`: Default `com.example.<appname-lowercase>`. 7–128 chars, ≥3 segments.
|
|
25
|
+
- `--api-level <level>`: int ≥17 (default: max API of the installed DevEco Studio/HarmonyOS SDK; falls back to 23 when unavailable).
|
|
26
|
+
- `--device-types <types...>`: One or more device types written to `module.json5` (default: `phone`). Supported: `phone`, `tablet`, `2in1`, `car`, `wearable`, `tv`. Unknown values fail with the supported list.
|
|
27
|
+
- `--template <name>`: Template logical name (default: `empty-ability`). `native-cpp` generates a project with C++/NAPI sources under `entry/src/main/cpp/`. Unknown names fail with the available template list.
|
|
28
|
+
*Ex*: `devecocli create --app-name MyApp --project-path ./CustomDir --api-level 23`
|
|
29
|
+
*Ex*: `devecocli create --app-name MyApp --device-types tablet`
|
|
30
|
+
*Ex*: `devecocli create --template native-cpp --app-name Shop`
|
|
31
|
+
|
|
32
|
+
### `devecocli create list`
|
|
33
|
+
List available project templates.
|
|
34
|
+
- `--format <default|json>`: `default` renders a Name/Description table; `json` prints a parseable array (fields: `name`, `bundleType`, `displayName`, `description`, `deviceTypes`).
|
|
35
|
+
*Ex*: `devecocli create list`
|
|
36
|
+
*Ex*: `devecocli create list --format json`
|
|
37
|
+
|
|
38
|
+
### `devecocli build` `[Outside sandbox]`
|
|
39
|
+
Compile and package project/modules. (Defaults: `--product default`, `--build-mode debug`)
|
|
40
|
+
- **AI agent invocation (Windows only)**: `devecocli build` must be launched inside a Start-Process wrapper; running it directly in the agent shell lets the `hvigor` daemon hold the console output pipe, so the agent cannot detect command completion and the window waits forever.
|
|
41
|
+
| Goal | Command |
|
|
42
|
+
|---|---|
|
|
43
|
+
| Single-module / single-`entry` | `devecocli build` |
|
|
44
|
+
| Specific modules | `devecocli build --modules <m1> <m2>@<target>` |
|
|
45
|
+
| Whole product bundle (.app) | `devecocli build --product <name>` |
|
|
46
|
+
| Override signing config | `devecocli build --signing-config <name>` |
|
|
47
|
+
| Clean build outputs | `devecocli build clean` |
|
|
48
|
+
| Clean specific modules | `devecocli build clean --modules <m1> <m2>` |
|
|
49
|
+
- **Build efficiency**: if build/clean is slow, consult https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/ide-build-optimize-practices for build optimization practices.
|
|
50
|
+
- **Clean mode**: `devecocli build clean [--mode <mode>] [--modules <m1> <m2>]` runs in module mode by default and reads build options (analyze/parallel/incremental/daemon) from `hvigor-config.json5` `execution`, matching DevEco Studio.
|
|
51
|
+
- **Build artifacts**: on success, prints absolute paths of all produced `.hap`/`.hsp`/`.har`/`.app` files for direct use.
|
|
52
|
+
- **debugLine**: disabled by default. Pass `--debug-line` to build to forward `-p debugLine=true` to hvigor.
|
|
53
|
+
- **Signing config**: `--signing-config <name>` overrides the product's default signing config from `build-profile.json5`, enabling release builds with a release signing config.
|
|
54
|
+
|
|
55
|
+
### `devecocli check lint`
|
|
56
|
+
Run DevEco Code Linter checks for TS/ArkTS code.
|
|
57
|
+
- **Studio requirement**: Default lint checks and `--fix`, `--incremental`, `--product`, `--config-path`, and `--limit` support DevEco Studio `>= 6.0.0`; explicitly using `--format` or `--output-path` requires DevEco Studio `>= 6.1.0`. Command Line Tools mode follows the CLT `>= 26.0.0` baseline.
|
|
58
|
+
- `[path]`: File or directory to lint. Defaults to the project root from `build-profile.json5`, otherwise the current directory.
|
|
59
|
+
- Options: `--config-path <file>`, `--fix`, `--incremental`, `--product <name>`, `--format <default|json>`, `--output-path <path>`, `--limit <number>`.
|
|
60
|
+
- Set `DEVECO_CLI_CLT_PATH` to the Command Line Tools root when DevEco Studio is not installed; CLT is not discovered automatically from PATH or default installation directories.
|
|
61
|
+
|
|
62
|
+
### `devecocli check arkts`
|
|
63
|
+
Run this command once after a round of edits, right before the build. Catches most ArkTS errors faster than a full build. Do not run it per edit.
|
|
64
|
+
- Before writing or editing `.ets`/ArkTS code, and again before running this command, follow the ArkTS/ArkUI coding rules in [docs/arkts-rules.md](docs/arkts-rules.md).
|
|
65
|
+
- `[files...]`: Specific `.ets` files to check. Defaults to all `.ets` files in the project.
|
|
66
|
+
- `--fix`: Auto-fix high-confidence errors (e.g., missing `export` keywords) before reporting.
|
|
67
|
+
- `--project <path>`: Project root directory. Defaults to auto-detection from cwd via `build-profile.json5`.
|
|
68
|
+
|
|
69
|
+
*Ex*: `devecocli check arkts --fix entry/src/main/ets/pages/Index.ets`
|
|
70
|
+
|
|
71
|
+
### `devecocli emulator`
|
|
72
|
+
Manage local emulator instances and system images.
|
|
73
|
+
- **Studio requirement**: DevEco Studio `>= 6.1.0`.
|
|
74
|
+
- `license view`: Read agreement text without changes.
|
|
75
|
+
- `license accept`: Accept all emulator agreements without displaying the text or prompting. For agents, use this when agreement acceptance is authorized, then resume the blocked operation after success. Ask only if authorization is missing. The bare `license` command requires a TTY and y/N input; do not use it in an Agent terminal.
|
|
76
|
+
- `list`: Show instances (status, serial, device type). Opt: `--format <table|json>` (default: `table`); `--details` (mutually exclusive with `--format`) dumps the raw JSON of `Emulator -list -details` verbatim — no field trimming/renaming.
|
|
77
|
+
- `start <names...>`: Start instances. Quote names with spaces. Opts: `--hdcport <10000-16555>` (Emulator `-hdcport`), `--boot-mode <coldboot|snapshot|reset>` (Emulator `-bootMode`; `coldboot` keeps user data, `snapshot` restores the last snapshot and needs Quick Boot, `reset` wipes data then cold boots; overrides the mode chosen when the instance was created), `--no-window` (Emulator `-noWindow`, headless start; required on Linux hosts without a GUI). (See Troubleshooting if blocked).
|
|
78
|
+
- `stop <names...>`: Stop by name or serial (`127.0.0.1:<port>`).
|
|
79
|
+
- Scene control commands require Emulator 7.0 or later. Use `DEVECO_CLI_DEBUG=1` to inspect the underlying `Emulator` command mapping.
|
|
80
|
+
- `shake` / `power` / `rotate <left|right>` / `volume <up|down>` (Req: `--target <nameOrSerial>`): Basic emulator controls.
|
|
81
|
+
- `fold <state>` (Req: `--target <nameOrSerial>`): Set foldable display state, matched against the target emulator's reported `deviceType`. `foldable` uses `open|half-open|close`; `2in1_foldable` uses `open|vertical-open|half-open|close`; `triplefold` uses `single|double|triple` or one of its six left/right folded-state combinations. Other device types and cross-device states are rejected before execution.
|
|
82
|
+
- `battery` (Req: `--target`; `--level <0-100>` and/or `--status <charging|discharging>`): Set battery state. `--level` and `--status` may be set together in one call. `--level` checks the current emulator charging state automatically (`0-100` while charging, `1-100` otherwise); `--level 0` combined with `--status discharging` is rejected as invalid.
|
|
83
|
+
- `geolocation` (Req: `--target`; `--longitude`+`--latitude` recommended together, missing one warns only; Opt: `--altitude`, `--direction`): Inject GPS data (multiple options in one call).
|
|
84
|
+
- `scene <outdoorRunning|outdoorCycling|drivingNavigation>` (Req: `--target`): Start motion simulation.
|
|
85
|
+
- `sensor` (Req: `--target`; `--light-intensity`/`--humidity`/`--temperature`/`--steps`/`--heartrate`, multiple may be set in one call): Inject sensor data.
|
|
86
|
+
- Multi-option `geolocation`/`battery`/`sensor` commands dispatch actions sequentially and are non-atomic: on action N failure, actions 1..N-1 are already applied with no rollback; re-run the whole command to converge.
|
|
87
|
+
- `create <name>` (Req: `--device-type`, `--os-version`): Create instance. Opts: `--instance-path <path>` (alias `--path`), `--image-root <path>`, `--screen-profile <model>`, `--screen <config...>`, `--storage <2-1023>`, `--memory <2-32>`, `--hot-boot <true|false>`, `--force`. Device type is case-insensitive. `--screen` accepts one quoted configuration or two for a foldable device in the format `width(px) height(px) DPI screen-diagonal-length(inch)`; width/height: 720-3500 px, DPI: 240-640, screen diagonal length: 3.5-9 inch. When combined with `--screen-profile`, `--screen` takes precedence. API 26+ uses hot boot by default unless explicitly disabled.
|
|
88
|
+
- `delete <name>`: Delete instance. Opt: `--instance-path <path>` (alias `--path`) — required to delete an instance created with a custom path.
|
|
89
|
+
- `image list`: List downloaded images. Opts: `--device-type <type>`, `--all`, `--format <table|json>`.
|
|
90
|
+
- `image download` / `image remove` (Req: `--device-type`, `--os-version`): Download/remove image. (Takes 30+ min, set long timeout).
|
|
91
|
+
*Device types*: `phone`, `foldable`, `widefold`, `triplefold`, `tablet`, `2in1`, `2in1 foldable`, `wearable`, `tv`.
|
|
92
|
+
|
|
93
|
+
### `devecocli workflow`
|
|
94
|
+
Static workflow engine: define multi-step AI agent workflows as YAML, run them with an engine/model, pause at gates, resume, and report.
|
|
95
|
+
- Run: `devecocli workflow run <name> --engine <type> [--model <model>]` · List: `workflow list` · Health: `workflow list --health` · Config overview: `workflow config`
|
|
96
|
+
- Agents live in `<workflow>/agents/*.yaml` only (no global/project agent tier). Set pairs per workflow: `workflow config set-agent <workflow> [--agent <name>] --engine <type> --model <model>`; clear with `workflow config unset-agent <workflow> [--agent <name>]`; inventory with `workflow list --agents` (`WORKFLOW/AGENT/ROLE/ENGINE/MODEL/PAIR`)
|
|
97
|
+
- Pair resolution: `run --engine/--model` > per-agent workflow config > workflow default > agent YAML > error. A run that supplies flags while nothing is configured remembers the pair as the workflow default (notice + `state.json` `agent_pair_source`); existing config is never overwritten
|
|
98
|
+
- Workflow config is not inherited by `type: workflow` sub-workflows — configure the child too, or pass run flags (they cover the whole run tree)
|
|
99
|
+
- `--foreground` exit codes: **0** completed · **1** failed · **2** stopped · **3** paused at a gate (answer: `workflow answer <runId> <value>`) · **4** a completed run has steps routed to a value listed by `--fail-on-route <a,b>`
|
|
100
|
+
- `delegate: true` gates need a resolvable decider pair when running with `--yes` (run flags > `--agent workflow-decider` > workflow default); without `--yes` they wait for a human
|
|
101
|
+
- `--verify` (strict) = live-call model verification before start: one minimal real call per (engine, channel, model) actually used (per-agent resolutions + the `--yes` decider); a catalog hit must still answer the live call, `not-listed` and bare-id multi-candidate (`ambiguous`) reject both tiers, engines without a model list (claude/codex) fall back to the live probe. `--verify=warn` = catalog check only with an "实际调用未验证" annotation. Unique bare-id mappings rewrite only the `--engine --model` run pair (agent configs get an advisory line only). The tier persists as the reserved `verify_tier` param: sub-workflow children run the same verify against their own config before the child run spawns (no tier → skip; failure = step failure → `exitRoutes.failed`)
|
|
102
|
+
- Project workflows with script steps require first-run consent (`--yes` records non-interactively; content changes re-consent)
|
|
103
|
+
- `writePolicy` (agent steps, hard promise per channel; undeclared = unrestricted): `read-only` (no writes) or `artifacts-only` (writes only to declared artifact paths). Only the **SDK channel enforces it** (strips `shell/build/run/lint`; `read-only` also strips `write`/`edit`, `artifacts-only` fences them to the artifacts). ACP cannot enforce it (its permission-request interception only stops tools that ask) — preflight rejects the run like CLI/JSONL, and resumes re-judge: every restricted step is re-checked against the SAME rule before the adapter call, using the engine+channel that execution actually resolved (`answer`/`resume`/`resumeFrom` respawn re-resolve agents from the current config) — an unenforceable pair fails the step (run `failed` with a `workflow resume` hint); restore an enforceable pair and resume. With multi-engine runs plus per-engine channel config, preflight can judge differently than the execution face (startup false-reject, or mid-run reject after a preflight pass) — the runtime verdict is final. The ACP request-level interception stays as in-channel enforcement depth. The agent `tools:` whitelist stays advisory (SDK-only filtering). Sub-workflows run the same check on the child config before the child run starts.
|
|
104
|
+
|
|
105
|
+
### `devecocli ui`
|
|
106
|
+
Inspect UI on a connected physical device or running emulator.
|
|
107
|
+
- `screenshot`: Capture a screenshot from a physical device or running emulator. `--device <name|serial>` is optional when exactly one device is connected, and required when multiple devices are connected.
|
|
108
|
+
- Optional: `--display <displayId>`. Required: `--path <path>` (existing directory or PNG file path, including paths relative to the current directory; writable destination; no overwrite).
|
|
109
|
+
- Implementation uses `hdc shell snapshot_display` and `hdc file recv`; set `DEVECO_CLI_DEBUG=1` to inspect the actual `hdc` commands.
|
|
110
|
+
*Ex*: `devecocli ui screenshot --device Phone --path ./screenshots/phone.png`
|
|
111
|
+
|
|
112
|
+
`screenrecord` records the screen of a physical device to an MP4 file (emulators are rejected). No subcommand enters interactive mode (Ctrl+C stops and saves); `start` returns immediately and the device keeps recording until `stop`. `--device <name|serial>` follows the same multi-device rule; interactive and `start` require `--path <dir|file.mp4>`. `status` reports `recording` / `busy` / `idle`; with `--format json`, stdout carries the JSON object. `stop --force` stops a recording not started by this CLI without downloading it (view it in the device gallery). A recording already stopped on the device can be recovered by `stop` on the same `DEVECO_CLI_DATA_DIR`. Starting again (interactive or `start`) deletes the interrupted registration without downloading the old video; the original remains in the device gallery.
|
|
113
|
+
*Ex*: `devecocli ui screenrecord start --device Phone --path ./recordings/` → `devecocli ui screenrecord stop --device Phone`
|
|
114
|
+
|
|
115
|
+
### `devecocli docs`
|
|
116
|
+
Search HarmonyOS developer documentation in the local HarmonyOS Knowledge Base — returns articles with examples and guidance on HarmonyOS APIs, ArkTS, and libraries. Typical use cases: finding API migration guides, examples for HarmonyOS APIs/ArkTS, up-to-date API references, and best practices for HarmonyOS development.
|
|
117
|
+
- `search <keywords...>`: Match any keyword. Opts: `--catalog <name>`, `--format <default|json>`, `--limit <n>`.
|
|
118
|
+
- `read <documentId>`: Read full content by ID (e.g. `devecocli docs read guides/harmonyos-guides/指南/系统/网络/网络`).
|
|
119
|
+
- `catalog`: List available catalogs.
|
|
120
|
+
- `update`: Update docs to the latest compatible version — downloads, sha512-verifies, and installs the docs-data package with atomic version switching; falls back to the bundled baseline if missing/corrupted. Opts: `--force`, `--check`.
|
|
121
|
+
|
|
122
|
+
Always use this tool to get the most up-to-date information about HarmonyOS concepts.
|
|
123
|
+
|
|
124
|
+
### `devecocli device`
|
|
125
|
+
Manage connected devices — device info, app management, system control, screen, files, clipboard, fonts, view mode, location mock, network simulation, and media playback. All subcommands accept `--device <name|serial>` (Req on multi-device hosts).
|
|
126
|
+
|
|
127
|
+
| Subcommand | Description | Key Options |
|
|
128
|
+
|---|---|---|
|
|
129
|
+
| `list` | Show active real devices and running emulators | `--format table\|json` (default: `table`) |
|
|
130
|
+
| `view` | Detailed device info | `-t <name\|serial>` (Req on multi-device), `--format table\|json` (default: `table`) |
|
|
131
|
+
| `sqlite3 <db-path>` | Run `sqlite3` on a device; all args after `db-path` forwarded as-is | Maps to `hdc -t <serial> shell sqlite3 <db-path> [args...]` |
|
|
132
|
+
| `app install [files...]` | Install hap/hsp packages | `--replace` (overwrite), `--shared <path>` (HSP libs, repeatable), `--wait <seconds>` (180–600), `--user <userId>` |
|
|
133
|
+
| `app uninstall` | Uninstall app by bundle name | `--bundle <name>` |
|
|
134
|
+
| `app list` | List installed apps | `--format default\|json` |
|
|
135
|
+
| `app info <bundleName>` | Show app details | `--format default\|json` |
|
|
136
|
+
| `app foreground` | Show current foreground app | `--format default\|json` |
|
|
137
|
+
| `app start` | Launch app ability | `--bundle <name>`, `--ability <name>`, `--action <action>`, `--uri <uri>` |
|
|
138
|
+
| `app stop` | Force-stop app | `--bundle <name>` |
|
|
139
|
+
| `app cleardata` | Clear app data | `--bundle <name>` |
|
|
140
|
+
| `app clearcache` | Clear app cache | `--bundle <name>` |
|
|
141
|
+
| `wake` | Wake screen | — |
|
|
142
|
+
| `sleep` | Suspend screen | — |
|
|
143
|
+
| `status` | Show screen state (AWAKE/SLEEP) | — |
|
|
144
|
+
| `unlock` | Wake + swipe-up to unlock (phone/tablet only, not 2in1) | — |
|
|
145
|
+
| `open-control-center` | Swipe to open control center (phone/tablet only) | — |
|
|
146
|
+
| `open-notification-center` | Swipe to open notification center (phone/tablet only) | — |
|
|
147
|
+
| `time [datetime]` | Get (no arg) or set system time | `[datetime]` positional arg |
|
|
148
|
+
| `timezone [timezone]` | Get (no arg) or set system timezone | `[timezone]` positional arg |
|
|
149
|
+
| `screen size` | Get screen resolution | `--format default\|json` (json: `{width, height}`) |
|
|
150
|
+
| `screen rotation` | Get current screen rotation | — |
|
|
151
|
+
| `screen rotate <angle>` | Set screen rotation angle | `<angle>`: `0\|90\|180\|270` |
|
|
152
|
+
| `screen rotation-lock <state>` | Lock/unlock auto-rotate | `<state>`: `on\|off` |
|
|
153
|
+
| `screen sleeptime <ms>` | Set screen-off timeout | `<ms>`: timeout in ms; `-1` = never sleep |
|
|
154
|
+
| `file send <local> <remote>` | Push file to device | `<local>` source path, `<remote>` dest path |
|
|
155
|
+
| `file recv <remote> <local>` | Pull file from device | `<remote>` source path, `<local>` dest path |
|
|
156
|
+
| `file exist <path>` | Check if file exists on device | `<path>` on-device file path |
|
|
157
|
+
| `file delete <path>` | Delete file on device | `<path>` on-device file path |
|
|
158
|
+
| `clipboard read` | Read clipboard text | — |
|
|
159
|
+
| `clipboard write <text>` | Write text to clipboard | `<text>` positional arg |
|
|
160
|
+
| `clipboard clear` | Clear clipboard | — |
|
|
161
|
+
| `font info <fontpath>` | Query font info | `<fontpath>` font file path |
|
|
162
|
+
| `font install <fontpath>` | Install font file | `<fontpath>` font file path |
|
|
163
|
+
| `font uninstall <name>` | Uninstall font by name | `<name>` font name |
|
|
164
|
+
| `viewmode` | Get current dark/light mode | — |
|
|
165
|
+
| `viewmode dark` | Set dark mode | — |
|
|
166
|
+
| `viewmode light` | Set light mode | — |
|
|
167
|
+
| `location set` | Mock location from coordinates | `--latitude <degrees>`, `--longitude <degrees>`, `--altitude <m>`, `--speed <m/s>`, `--direction <degrees>` (0–360), `--interval <seconds>` (1–3600, default 1) |
|
|
168
|
+
| `location set` (gpx) | Mock location from GPX file | `--gpx-file <path>`, `--interval <seconds>` (mutually exclusive with lat/lon mode) |
|
|
169
|
+
| `location enable` | Turn on location mock (also done automatically by `set`) | — |
|
|
170
|
+
| `location disable` | Turn off and restore real location | — |
|
|
171
|
+
| `network-sim start` (preset) | Start preset scenario (1–8) | `--id <n>` |
|
|
172
|
+
| `network-sim start` (custom) | Start custom network scenario | `--name <n>`, `--up-bandwidth <bps>`, `--down-bandwidth <bps>`, `--up-latency <ms>`, `--down-latency <ms>`, `--up-drop <0-1>`, `--down-drop <0-1>` (`--id` and custom options mutually exclusive) |
|
|
173
|
+
| `network-sim stop` | Clear simulation, delete custom scenario, disable netcopilot (idempotent) | — |
|
|
174
|
+
| `network-sim list` | Show preset scenarios | — |
|
|
175
|
+
| `network-sim status` | Report enabled/disabled | — |
|
|
176
|
+
| `playback list` | Show active media sessions (bundle name + session ID) | — |
|
|
177
|
+
| `playback play` | Play media | `--id <sessionID>` or `--bundle <bundleName>` |
|
|
178
|
+
| `playback pause` | Pause media | `--id <sessionID>` or `--bundle <bundleName>` |
|
|
179
|
+
| `playback next` | Next track | `--id <sessionID>` or `--bundle <bundleName>` |
|
|
180
|
+
| `playback previous` | Previous track | `--id <sessionID>` or `--bundle <bundleName>` |
|
|
181
|
+
| `playback forward` | Fast forward (step size app-defined) | `--id <sessionID>` or `--bundle <bundleName>` |
|
|
182
|
+
| `playback rewind` | Rewind (step size app-defined) | `--id <sessionID>` or `--bundle <bundleName>` |
|
|
183
|
+
| `playback seek` | Jump to position | `--position <seconds>`, `--id <sessionID>` or `--bundle <bundleName>` |
|
|
184
|
+
|
|
185
|
+
- `location`: requires system version 7.0+ (testhelper).
|
|
186
|
+
- `network-sim`: requires API 20+ (netcopilot).
|
|
187
|
+
- `playback`: requires system version 6.1+ (ohos-avsession-manager).
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
### `devecocli run` `[Outside sandbox]`
|
|
192
|
+
Build, install, and launch. After a successful ability launch (and after a successful `--apply`), runs a **default smoke check**. Success prints `Smoke: PASS`; failures print `Smoke: FAIL_CRASH` or `Smoke: FAIL_BLANK` or `Smoke: FAIL_UI_OVERLAP` (crash log path via `crash_log:`, blank screenshot via `screenshot:`, overlap JSON via `FAIL_UI_OVERLAP:` at `<project>/.hvigor/smoke/<run-id>/smoke-ui-overlap-<ts>.json`) and exit non-zero. Smoke is skipped when there is no ability to launch, and for `--hotreload` / `--hotreload-apply`.
|
|
193
|
+
- `--module <m1> [m2...]`: Target module(s) (auto-selected if only one runnable).
|
|
194
|
+
- `--device <name|serial>`: Target device (Req if multiple connected).
|
|
195
|
+
- `--product <product>` / `--build-mode <mode>`: Defaults: `default` / `debug`.
|
|
196
|
+
- `--ability <ability>`: Default from `module.json5`.
|
|
197
|
+
- `--uninstall`: Uninstall existing app first (Fixes signing key issues).
|
|
198
|
+
- `--skip-build`: Deploy existing artifacts.
|
|
199
|
+
- `--debug-line`: Forward `-p debugLine=true` to hvigor for the full build, `--apply`, and hot-reload compiles (default: disabled).
|
|
200
|
+
- `--apply <fileName>`: **Fast incremental deploy** — rebuilds only changed files into a signed hqf, installs via `bm quickfix -a -f -o`, then restarts the app. Much faster than a full `devecocli run` for iterating on code changes. Modules are auto-detected from the file paths in `<fileName>` (no `--module` needed).
|
|
201
|
+
- `<fileName>`: a plain file name (no path separators) under the project's `.hvigor/` directory; the caller writes the changed-file list there. File name is sanitized to prevent path traversal. Content: list of **source file paths changed this round** (one per line, relative to project root or absolute; `#` comments and blank lines ignored; typically `.ets`/`.ts`/`.cpp`/resource files). The changeFileList is **incrementally merged** — only list files changed since the last apply; previously listed files are retained automatically.
|
|
202
|
+
- **Prereq**: DevEco Studio ≥6.1.1 (hvigor `assembleDevHqf` support; below is rejected with an upgrade hint); run `devecocli run` once first (full build + deploy — `--apply` reuses its build intermediates and generates its own short-lived `buildConfig.json` per apply). Normal `run`/`build` clears the symbol table required by cold-reload ArkTS patches; the first `--apply` with ArkTS changes after a normal build automatically runs a full `assembleHap`/`assembleHsp` bootstrap (by module type) to regenerate it (may take tens of seconds on a cold cache; resource-only applies skip this). Consecutive applies without an intervening normal build reuse the symbol table and are fast.
|
|
203
|
+
- **Do not mix with an active `--hotreload` watch session**: both drive patch builds over the same per-module `buildConfig.json`; stop the session (`--hotreload stop`) first.
|
|
204
|
+
- **If changes don't take effect**: on any apply failure, fall back to a full `devecocli run`. Note: the bootstrap rebuild produces a hap containing `ets/symbolMap.map` (hot-reload compilation side effect); this is harmless for `--apply` (only the hqf is installed, not the hap) and the next normal `run`/`build` cleans it — a later `run --skip-build` would deploy that regenerated hap as-is.
|
|
205
|
+
*Ex*: `devecocli run` → edit code → write `.hvigor/changes.txt` → `devecocli run --apply changes.txt`
|
|
206
|
+
- `--hotreload [action]`: **Hot-reload watch session** — must be started as a **background process** (the process holds a persistent socket to the hvigor daemon). It builds the hap in hot-reload mode (`hotReload=true debuggable=true`), deploys+launches the app, then the process itself connects a socket to the daemon and sends `CommonBuild assembleHap --hot-reload-build --watch`, **staying connected** so the daemon's watch worker (rollup watch) stays alive for `--hotreload-apply` to reuse. The process stays alive (onBuildOutput streams to its stdout). **Must be stopped (kill the background process) when the hot-reload debug session ends** — otherwise the watch worker/daemon leaks. `--hotreload stop` additionally stops the hvigor daemon.
|
|
207
|
+
- **Usage**: start `devecocli run --module <m> --hotreload` as a background process; wait for the `.hotreload-mode` marker (or "watch session active" on its stdout) = ready; then run `devecocli run --module <m> --hotreload-apply <file>` (foreground). When done: kill the background process + `devecocli run --hotreload stop`.
|
|
208
|
+
- `--hotreload-apply <fileName>`: **Hot reload without app restart** — reads the changed-file list from `.hvigor/<fileName>` (same format/merge rules as `--apply`), opens a **short socket** to the daemon (kept alive by the background `--hotreload` process) and sends `CommonBuild assembleDevHqf --hot-compile` → the watch worker incrementally hot-compiles changed `.ets`/`.ts` into abc (HotReloadArkTS; output/errors streamed live via WatchLog), then **manually** packs + signs a hqf from that abc (`app_packing_tool.jar` + `hap-sign-tool.jar`, DevEco material password decrypted via `DecipherUtil`), and installs it via `bm quickfix -a -f -o`. The app is **not restarted** — changes take effect immediately.
|
|
209
|
+
- **Prereq**: the background `devecocli run --hotreload` process must be running (holds the watch session). If `--hotreload-apply` times out, the watch session isn't alive — (re)start the background `--hotreload`.
|
|
210
|
+
- **Session exclusivity**: do not run `--apply` or a normal `run`/`build` against the project while the watch session is live — they clear the `buildConfig.json` the session's hot compile depends on. Stop the session (`--hotreload stop`) first, restart it after.
|
|
211
|
+
- **Scope (important)**: hot reload targets a **single module** (`--module` required; the target can be entry/hsp/feature; `har` deps are folded in and fine). **`har` dependency changes are auto-routed** to the dependent main module's (entry/feature/hsp) `hotReload/changedFileList.json` — so editing a har's `.ets` and listing it hot-reloads via the target module. Changes in **`feature`/`hsp` dependency modules** (not the target) are NOT hot-reloadable — they're detected and warned (run a full `devecocli run` to redeploy those). `@State`/state-decorator changes are **not** hot-reloadable (state isn't re-initialized); hot-reloadable changes are non-state code: UI property values (`.fontColor`/`.fontSize`), `Text`/`Button` literal labels, method bodies, expressions. Resources/native changes need a full run.
|
|
212
|
+
- **Compile errors**: ArkTS compile errors from the hot compile are routed (via WatchLog) to the **background `--hotreload` process**, which writes them to **`.hvigor/hotreload-watch.log`** (and its stdout). On failure, `--hotreload-apply` reads that file and prints the errors inline (fast-fail, ~15s timeout if the watch session is dead).
|
|
213
|
+
- **Artifacts under `.hvigor/`** (shared with `--apply`): `.hvigor/<fileName>` = the changed-file list you write; `.hvigor/hotreload-watch.log` = the watch session's onBuildOutput/compile-errors (written by the background `--hotreload` process; safe to read/delete). The hot-reload marker is `<module>/build/<product>/.hotreload-mode`.
|
|
214
|
+
*Ex*: background `devecocli run --module entry --hotreload` → (ready) → edit `.fontColor` in `entry/src/main/ets/pages/Index.ets` → write path to `.hvigor/changes.txt` → `devecocli run --module entry --hotreload-apply changes.txt` (UI updates without restart). When done: kill the background process + `devecocli run --hotreload stop`.
|
|
215
|
+
|
|
216
|
+
### `devecocli debug` `[Outside sandbox]`
|
|
217
|
+
ArkTS debugger (breakpoints, logpoints, variable read/write, event stream) over `hdc fport` + CDP, no IDE needed. All subcommands are short RPC calls to **one global background daemon** (hidden `debug __daemon`, auto-spawned by the first debug command, exits after 30 idle minutes; one session per bundle — `SESSION_EXISTS` on conflict; mutually exclusive with IDE debugging). Everything lives under `~/.devecocli/debug/<userTag>/`: `daemon.json` and `daemon.log` (every CLI↔daemon RPC body).
|
|
218
|
+
- **AI invocation (important)**: while the daemon is offline, any debug command — including `status` — may hang the agent shell (the spawned daemon inherits console handles). Run the first call through a file-redirection wrapper without `-Wait`, then poll the file for the `{"ok":...}` line: `Start-Process $env:ComSpec -ArgumentList '/c devecocli debug status > out.txt 2>&1' -WindowStyle Hidden`. Once the daemon is online, short commands return normally. `events --follow` streams forever — run it the same wrapper way (or a bounded background job), or collect evidence via `--logpath` instead. Judge start/attach readiness via `debug status --json` (`state:"starting"` with `phase:"building|installing|launching|connecting"`, ready at `running`/`paused`), not by scraping stdout.
|
|
219
|
+
- `debug start [-b <bundle>] [--module <m>] [--ability <a>] [--product <p>] [--device <name|serial>] [--stop-at-entry] [--skip-build] [--logpath <file>] [--json]`: debug build → install → `aa start` (`-D` with `--stop-at-entry` so the app parks at each module entry) → `hdc fport` + CDP. Success `{"ok":true,"sessionId","pid","state",...}`: `paused` + `Break on start` with `--stop-at-entry` (parks stay until `debug resume`), else `running`. `--skip-build` reuses the last debug artifacts. `--logpath <file>` = whole-session NDJSON event journal, flushed per line (a directory auto-resolves to `<dir>/cli-debug.log`; unwritable → `LOGPATH_INVALID` before the build). With `--stop-at-entry`, the command returns `TIMEOUT` if the pause does not arrive in time or `CDP_ERROR` if the debugger disconnects.
|
|
220
|
+
- `debug attach -b <bundle> [--pid <n>] [--module <m>] [--device <d>] [--logpath <f>] [--json]`: attach to an already-running app, no rebuild/redeploy; run inside the project (source maps come from `<module>/build/`, elsewhere `INTERNAL: Not in a valid project directory`); non-debuggable app → `ATTACH_FAILED`.
|
|
221
|
+
- `debug status [--json]`: `Debug service: online (daemon <version>)` + one line per session — `state`, pause location `@ <path>:<line>`, worker channels (`sN.w<inst>`), `connectServer`; sessions still starting show `starting (<phase>)`.
|
|
222
|
+
- `debug stop [--session <sN | sN.w<inst>>]`: end the session (auto-resume if paused, clean its fport rules) — **the app keeps running**. Passing a worker channel id tears down only that channel (response carries `parentSession`/`remainingWorkers`).
|
|
223
|
+
- Breakpoints, session-scoped: `bp add --path <project-relative file> --line <n> [--column <c>] [--condition <expr>] [--hit-count <N|=N|>=N|<=N|%N>] [--log <expr>] [--level <debug|info|warn|error>] [--disabled]` → `{"ok":true,"id","kind":"breakpoint"|"logpoint",...}`; bound breakpoints carry the CDP return (`vmId`, resolved artifact `jsUrl:jsLine`), others stay pending until `scriptParsed` binds them (`verified`). Stale-source guard: source mtime newer than `sourceMaps.map` → `SOURCEMAP_RESOLVE_FAILED` (rebuild first). `bp remove (--id | --path [--line] | --all)`, `bp list [--kind ...]`, `bp enable|disable (--id | --path --line | --all)` — table changes broadcast live to every worker channel; disabled breakpoints keep the definition but never trigger. `--condition` gates by JS truthiness (operands evaluated in the VM, compared daemon-side); `--log` = **non-interrupting logpoint**: evaluate → emit `logpoint` event → auto-continue.
|
|
224
|
+
- `debug resume [--thread <id|name|all>]` (all threads by default; `NOT_PAUSED` when already running) / `debug pause` (an idle app parks at the next executed statement) / `debug step --into|--over|--out` (needs `paused`; a `--out` landing outside debuggable code may report `TIMEOUT: step out timeout`).
|
|
225
|
+
- `debug stack [--frame <i>] [--max <n>]` → `frames[]` with real frame indices (`--frame` = start index, 0 = innermost; `total` = full stack depth); `debug vars [--frame <n>] [--name <varPath>]` → `vars[]` (innermost `[scope]` entry = frame scope); `debug eval <expr> [--frame <n>]` → `result`; `debug set --name <v> --value <expr>` → `oldValue`/`newValue`/`vmApplied`. Paused state only.
|
|
226
|
+
- `debug events [--follow] [--filter <type[:level],...>] [--session <id>]`: summary only without `--follow` (no history replay — use `--logpath`); live NDJSON with `--follow`. Event types: `rpc` (per request/response of every session command), `breakpoint` (mutations + async verified/failed binds), `paused` (with `bps[]` when breakpoint-caused), `resumed`, `bp-hit` (with `action:"pass"|"pause"`), `logpoint`, `console`, `terminated`, `auto-stopped` (app exit / CDP channel closed), worker `attached`/`detached`. Raw CDP frames can be journaled by setting `DEBUG_FRAME_LOG=<file>` before the daemon spawns.
|
|
227
|
+
- **Real-device VM limits (HarmonyOS NEXT devices, e.g. Mate 60 Pro)**: `Debugger.evaluateOnCallFrame` resolves simple identifiers only — dot-paths (`this.message`) are compensated daemon-side via the `getProperties` chain (`@State` auto-unwrap), but calls (`this.calc(2)`), indexing (`arr[0]`) and unresolvable arithmetic still return `undefined`; `set` never applies — the CLI records an overlay (`vmApplied:false`) scoped to the current pause event **and frame** so `eval`/`vars` read back the set value only for that frame, until the next pause/resume. Read state via `vars`/dot-path `eval`; keep log expressions to bare variables or dot-paths. Emulators evaluate the richer forms. Not a session bug — do not rebuild around it.
|
|
228
|
+
- Output contract: human-readable by default, `--json` = one compact JSON line (`events --follow` = NDJSON). Failures are uniformly `{"ok":false,"error":{"code","message"}}` with exit 1 (`NO_SESSION`/`SESSION_EXISTS`/`NOT_PAUSED`/`BP_NOT_FOUND`/`APP_NOT_RUNNING`/`TIMEOUT`/`DAEMON_OFFLINE`/...). Redirected human output ends with its result JSON line — pollable without `--json`.
|
|
229
|
+
*Ex*: cold daemon: wrapper-run `debug status` → wrapper `devecocli debug start --stop-at-entry --json` → `debug resume` → `debug bp add --path entry/src/main/ets/pages/Index.ets --line 30` → trigger UI → `debug status`/`stack`/`vars` → `debug resume` → `debug stop`. Evidence: add `--logpath C:\logs\dbg.ndjson` and read the file instead of `events --follow`.
|
|
230
|
+
|
|
231
|
+
### `devecocli signature generate` `[Outside sandbox]`
|
|
232
|
+
Auto-generate HarmonyOS debug signing materials (local p12/csr + cloud cert + profile) and write signing config to `build-profile.json5`. Release signing is not supported; apply through [AppGallery Connect](https://developer.huawei.com/consumer/cn/doc/doccenter-deveco-studio/ide-publish-app#section1079214271414) and configure release materials manually in `build-profile.json5`.
|
|
233
|
+
- **Prereq**: Authenticate with `devecocli auth login --no-prompt` if needed and authorized (see Setup); run from a project directory (with `build-profile.json5`); a connected device or emulator is required for device registration.
|
|
234
|
+
- `--product <name>`: Product name for local p12/csr file naming (default: `default`).
|
|
235
|
+
- `--team-id <id>`: Specify the team-id (default: current user's id).
|
|
236
|
+
- `--type <type>`: Optional compatibility parameter. Only `debug` is accepted (default: `debug`); `release` exits nonzero with guidance to apply through AppGallery Connect.
|
|
237
|
+
- `--force`: Force regenerate even if existing materials are valid.
|
|
238
|
+
- Generates debug materials under `~/.ohos/config/`: `.p12` keystore, `.csr`, downloaded `.cer` certificate, `.p7b` profile.
|
|
239
|
+
- Writes `signingConfigs` + `products` entries to `build-profile.json5` with encrypted key/store passwords (AES-128-GCM), using the product name as the config name.
|
|
240
|
+
- Cloud cert name: `auto_debug_<teamId>.cer`. Key alias: `debugKey`.
|
|
241
|
+
- Error handling (aligned with DevEco Studio JAR): 401→re-login, 403→no AGC permission, `205389872`→cert limit, `205389904`→not Harmony user, `205389938`→provision limit, invalid `.cer`→retry.
|
|
242
|
+
*Ex*: `devecocli signature generate --product default` / `devecocli signature generate --type debug`
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
### `devecocli log`
|
|
246
|
+
Fetch hilog or crash logs. Req `--device <name|serial>` on multi-device hosts.
|
|
247
|
+
- `--crash`: Dump crash logs.
|
|
248
|
+
- `--level D|I|W|E|F`: Filter by level.
|
|
249
|
+
- `--bundle-name` / `--keyword`: Filter output.
|
|
250
|
+
- `--from <start>` / `--to <end>`: Relative offsets (`30s`, `5m`).
|
|
251
|
+
- `--tail <num>` / `--follow`: Keep last N lines / stream real-time (no `--to`).
|
|
252
|
+
- `--path <path>` + `--crash`: Analyze a local fault log file or directory (cpp_crash / js_crash / app_freeze) instead of pulling from device; picks the most relevant candidate when given a directory.
|
|
253
|
+
- `--stack` + `--path <file>`: Analyze a local sample stack file (enhanced log); mutually exclusive with `--crash`.
|
|
254
|
+
- `--format default|json|report|hilog`: Output format for local analysis (`hilog` extracts the HiLog section, `--crash` only).
|
|
255
|
+
- `--limit <num>`: Max hotspots shown by `--stack` (default 20).
|
|
256
|
+
- `--path` cannot be combined with device log options (`--device`, `--level`, `--bundle-name`, `--keyword`, `--tail`, `--from`, `--to`, `--follow`).
|
|
257
|
+
*Ex*: `devecocli log --crash --bundle-name com.example.app`, `devecocli log --level E --from 5m --tail 200`, `devecocli log --crash --path ./faultlog --format report`, `devecocli log --stack --path sample_stacks.txt --limit 20`
|
|
258
|
+
|
|
259
|
+
### `devecocli verify`
|
|
260
|
+
Run UI verification on a connected device. Based on natural-language functional steps, the tool launches the app, uses screenshots to judge the current UI state, performs UI operations, and verifies whether the functionality completes correctly. This is the standard tool for UI testing and issue reproduction.
|
|
261
|
+
|
|
262
|
+
Supported operations include tap, double-tap, swipe, long press, key input, mouse, and keyboard actions. Supported navigation includes direct navigation to a specified page via a URI in a test step. When using URI navigation, the test plan must provide the complete, explicit, directly executable URI; do not only describe the target page or omit the URI content.
|
|
263
|
+
|
|
264
|
+
- `--test-plan <plan>` (**required**) — Natural-language test plan describing each step and its expected result. The test plan must not exceed 3000 characters. **Must be wrapped in single quotes** (`--test-plan '...'`) to prevent shell interpretation. Write a clear, specific plan based on the user's description. Example:
|
|
265
|
+
```
|
|
266
|
+
1. 启动应用,预期:进入应用主界面,底部显示「书架」「发现」「订阅源」三个Tab
|
|
267
|
+
2. 点击「发现」Tab,预期:进入发现页面
|
|
268
|
+
3. 点击「订阅源」Tab,预期:进入订阅源页面
|
|
269
|
+
4. 点击「书架」Tab,预期:返回书架页面
|
|
270
|
+
```
|
|
271
|
+
- `--bundle-name <name>` — Bundle name of the app to be tested; auto-detected from `AppScope/app.json5` when omitted.
|
|
272
|
+
- `--no-fresh-start` — Skip relaunching the app before verification; omit to relaunch by default.
|
|
273
|
+
- `--device <name|serial>` — device name (substring) or serial; auto-selected on single-device hosts, **required on multi-device hosts**. Quote names with spaces (e.g. `--device "Mate 70 Pro"`).
|
|
274
|
+
|
|
275
|
+
Output JSON contains `success`, `reason` (failure cause), `successPart`, `failPart`, `failType`, and `id` (unique task ID for log and screenshot retrieval). `failType` is `''` when verification passed. Otherwise it is `verification_failed` (a step did not meet its expectation), `unsupported` (a required action is outside the tool, including sound, haptics, and acting on a moving target), `invalid_plan` (the plan is not a valid test, or this device cannot run it), `execution_error` (the run stopped before a conclusion), or `inconclusive` (the evidence cannot separate an app failure from a tool limit, including the round limit).
|
|
276
|
+
|
|
277
|
+
Each UI verification run is limited to 10 minutes.
|
|
278
|
+
|
|
279
|
+
Usage guidance:
|
|
280
|
+
- Write a test plan based on the user's description and call `devecocli verify --test-plan '...'`
|
|
281
|
+
- If log analysis is needed, call `devecocli verify log --id <id>` to retrieve the execution log
|
|
282
|
+
- If screenshots are needed, call `devecocli verify screenshot --id <id> --save-path <path>` to save step-by-step screenshots
|
|
283
|
+
|
|
284
|
+
Examples:
|
|
285
|
+
- `devecocli verify --test-plan '1. 启动应用,预期:进入应用主界面'`
|
|
286
|
+
- `devecocli verify --test-plan '1. 启动应用,deeplink跳转到"aigomall://test/order-confirm",预期:显示订单提交页面'`
|
|
287
|
+
- `devecocli verify --test-plan '1. 启动应用,预期:进入应用主界面' --bundle-name com.example.app`
|
|
288
|
+
- `devecocli verify --test-plan '1. 启动应用,预期:进入应用主界面' --no-fresh-start`
|
|
289
|
+
- `devecocli verify --test-plan '1. 启动应用,预期:进入应用主界面' --device 127.0.0.1:5555`
|
|
290
|
+
|
|
291
|
+
### `devecocli verify appanalyzer` `[Outside sandbox]`
|
|
292
|
+
Run local health checks for apps and atomic services through the bundled AppAnalyzer CLI: it inspects the running app, then reports analysis guidance and fix suggestions.
|
|
293
|
+
- **Prereq**: Command Line Tools install source (not available in DevEco Studio) with the AppAnalyzer component. Run `devecocli verify appanalyzer init` before any check to initialize the environment.
|
|
294
|
+
|
|
295
|
+
| Subcommand | Description |
|
|
296
|
+
|---|---|
|
|
297
|
+
| `init` | Initialize the tool environment (installs Python dependencies). |
|
|
298
|
+
| `autoAnalyze` | Automated page traversal + detection. |
|
|
299
|
+
| `uxAnalyze` | Manual single-page UX detection; put the device on the target page and keep the screen on first. |
|
|
300
|
+
| `powerAnalyze` | Manual power-consumption detection: records ~15s of the app standing by in the foreground, then reports. Real devices only. |
|
|
301
|
+
|
|
302
|
+
- **Common options**: `-b/--bundleName` (Req), `-p/--projectPath` (Req), `-s/--scenes` (default: recommended scenes), `-d/--device <serial|IP:port>` (default: first available real device, else first emulator), `-o/--output <reportPath>` (default: cwd), `-m/--hapPaths` (only with the basic scene, for icon checks).
|
|
303
|
+
- `autoAnalyze` also takes `-t/--duration <minutes>` (5–240, default `10`).
|
|
304
|
+
- Reports are written as both JSON and ZIP to the output path.
|
|
305
|
+
|
|
306
|
+
**Scenes** — `-s` takes a category (`Dxx`, runs every scene under it) or individual scenes (`Sxx`, comma-separated):
|
|
307
|
+
|
|
308
|
+
| Category | Meaning | Scenes |
|
|
309
|
+
|---|---|---|
|
|
310
|
+
| `D03` | UX — multi-device layout adaptation | `S14` truncation, `S15` large image/large font, `S16` white space, `S17` avoid-area occlusion, `S18` foundation |
|
|
311
|
+
| `D04` | Power consumption | `S11` foreground standby |
|
|
312
|
+
|
|
313
|
+
*Ex*: `devecocli verify appanalyzer init`
|
|
314
|
+
*Ex*: `devecocli verify appanalyzer autoAnalyze -b com.example.app -p ./MyApp -s D03 -t 5 -o ./output`
|
|
315
|
+
*Ex*: `devecocli verify appanalyzer uxAnalyze -b com.example.app -p ./MyApp -s S14,S15 -d 127.0.0.1:5555`
|
|
316
|
+
*Ex*: `devecocli verify appanalyzer powerAnalyze -b com.example.app -p ./MyApp`
|
|
317
|
+
|
|
318
|
+
### `devecocli verify log`
|
|
319
|
+
Retrieve the execution log of a verification task by ID.
|
|
320
|
+
|
|
321
|
+
- `--id <id>` (**required**) — Task ID from the `id` field in `verify` output.
|
|
322
|
+
- `--search-keywords <keywords>` — Filter to lines containing the keyword; **wrap value in single quotes**.
|
|
323
|
+
- `--max-log-size <n>` — Max characters to show (default `5000`; `-1` for unlimited).
|
|
324
|
+
|
|
325
|
+
Examples:
|
|
326
|
+
- `devecocli verify log --id <id>`
|
|
327
|
+
- `devecocli verify log --id <id> --search-keywords 'error' --max-log-size -1`
|
|
328
|
+
|
|
329
|
+
### `devecocli verify screenshot`
|
|
330
|
+
Save step-by-step screenshots from a verification task to a specified directory; returns a list of saved file paths.
|
|
331
|
+
|
|
332
|
+
- `--id <id>` (**required**) — Task ID from the `id` field in `verify` output.
|
|
333
|
+
- `--save-path <path>` (**required**) — Absolute path to the target directory (created automatically if it does not exist).
|
|
334
|
+
|
|
335
|
+
Examples:
|
|
336
|
+
- `devecocli verify screenshot --id <id> --save-path 'C:\Users\user\Desktop\screenshots'`
|
|
337
|
+
|
|
338
|
+
### `devecocli ui`
|
|
339
|
+
Inspect UI on a connected device. All subcommands accept `--device <name|serial>` (Req on multi-device hosts).
|
|
340
|
+
|
|
341
|
+
| Subcommand | Description | Key Options |
|
|
342
|
+
|---|---|---|
|
|
343
|
+
| `layout` | Dump ArkUI accessibility layout tree — **visible area only** (on-screen nodes). Requires device API 20+ | `--id <id>`, `--window <windowId>`, `--all-windows`, `--depth <n>` (0=unlimited, 1=root only, 2=root+children), `--format default\|json`, `--mode full\|simplified` |
|
|
344
|
+
| `window list` | List active windows | `--format default\|json`, `--all` (include system windows) |
|
|
345
|
+
| `display list` | List displays with id, width and height (px); source of `--display <displayId>` values for `ui screenshot` (see **UI verification loop**) | `--format default\|json`, `--all` (add screen id, refresh rate, VPR, rotation columns; unreported fields render as `-`, or `null` in json) |
|
|
346
|
+
| `screenshot` | Capture a screenshot of the device screen | `--display <displayId>`, required `--path <path>` (existing directory or PNG file path; relative paths supported; writable destination; no overwrite) |
|
|
347
|
+
| `screenrecord` | Record the screen to an MP4 file (physical devices only; emulators are rejected) | interactive by default, or `start` / `stop` / `status`; required `--path <dir|file.mp4>` for interactive and `start`; `stop --force` stops a recording not started by this CLI; `status --format table\|json` |
|
|
348
|
+
| `click [x] [y]` | Tap at the specified coordinates or node | `--id <id>` (auto-resolves to center), `--selector <expr>`, `--window <windowId>` (used with coordinates, `--id`, or `--selector`; supports secondary displays) |
|
|
349
|
+
| `doubleclick [x] [y]` | Double-tap at the specified coordinates or node | `--id <id>`, `--selector <expr>`, `--window <windowId>` (used with coordinates, `--id`, or `--selector`; supports secondary displays) |
|
|
350
|
+
| `longclick [x] [y]` | Long-press at the specified coordinates or node | `--id <id>`, `--selector <expr>`, `--duration <ms>` (500–60000, default 1000; custom values primary display only), `--window <windowId>` (used with coordinates, `--id`, or `--selector`; supports secondary displays) |
|
|
351
|
+
| `swipe <x1> <y1> <x2> <y2>` | Swipe from one point to another (coordinates or element mode) | `--start <expr> --end <expr>` (element mode; both required together), `--speed <n>` (200–40000, px/s), `--window <windowId>` (coordinates or elements; supports secondary displays) |
|
|
352
|
+
| `fling <x1> <y1> <x2> <y2>` | Fling from one point to another | `--speed <n>` (200–40000, px/s), `--window <windowId>` (supports secondary displays) |
|
|
353
|
+
| `drag <x1> <y1> <x2> <y2>` | Drag from one point to another (coordinates or element mode) | `--start <expr> --end <expr>` (element mode; both required together), `--speed <n>` (200–40000, px/s), `--window <windowId>` (coordinates or elements; supports secondary displays) |
|
|
354
|
+
| `dircfling <direction>` | Quick directional fling (system default speed, ideal for scrolling) | `direction`: `up`, `down`, `left`, `right`; `--window <windowId>` (supports secondary displays) |
|
|
355
|
+
| `text <text> [x] [y]` | Input text at a target location or the currently focused field | `--id <id>` (auto-resolves to center), `--selector <expr>`, `--window <windowId>` (used with a target or alone for focused input; supports secondary displays) |
|
|
356
|
+
| `cleartext` | Clear text via Ctrl+A + Del (optionally click target element first) | `--selector <expr>` (click before clearing; default: focused field), `--window <windowId>` |
|
|
357
|
+
| `scrolltostart` | Scroll a scrollable container to the start (top) | `--selector <expr>` (default: first scrollable element), `--speed <n>` (200–40000, default 1500), `--timeout <ms>` (1–3600000, default 60000) |
|
|
358
|
+
| `scrolltoend` | Scroll a scrollable container to the end (bottom) | `--selector <expr>` (default: first scrollable element), `--speed <n>` (200–40000, default 1500), `--timeout <ms>` (1–3600000, default 60000) |
|
|
359
|
+
| `scrollsearch <selector>` | Scroll within a container and search for a target element | `--scroll-selector <expr>` (default: first scrollable element), `--vertical <true\|false>` (default true), `--offset <n>` (≥0, default 80), `--timeout <ms>` (1–3600000, default 60000) |
|
|
360
|
+
| `pinch <scale> [x] [y]` | Pinch (zoom) at an element or coordinates | `--selector <expr>`, `--area-radius <n>` (integer ≥50; default: 300 for coords, 90% of area for element/screen), `--speed <n>` (600–3000, default 600), `--window <windowId>` |
|
|
361
|
+
| `rotate <angle> [x] [y]` | Two-finger rotation at an element or coordinates | `--direction <cw\|ccw>` (default cw), `--selector <expr>`, `--radius <n>` (50–500, default 300), `--speed <n>` (200–40000, default 1500), `--window <windowId>` (used with `--selector`) |
|
|
362
|
+
| `press_key <key1> [key2] [key3]` | Press hardware/system key(s), up to 3 for combos | keys: string name (`back`/`enter`/`ctrl_left`) or numeric keycode |
|
|
363
|
+
| `find [selector]` | Find UI element(s) by selector DSL, XPath, or base64 — polls until match or timeout | `--device`, `--window <windowId>`, `--all` (return all matches), `--timeout <ms>` (default 3000, max 360000), `--format default\|json` |
|
|
364
|
+
| `wait [timeoutMs]` | Wait for element to appear/disappear, or pure sleep if no selector | `--device`, `--window <windowId>`, `--disappear` (wait for element to disappear; requires selector); `<selector>` as positional arg triggers element wait mode |
|
|
365
|
+
|
|
366
|
+
- **Coordinates vs `--id`/`--selector`**: Mutually exclusive. Provide either `x y`, `--id <id>`, or `--selector <expr>`. For `text`, if none is given, text goes to the currently focused field. For `swipe`/`drag`, use either coordinates or `--start <expr> --end <expr>` (both required together).
|
|
367
|
+
- **`--window` and secondary displays**: `click`, `doubleclick`, `longclick`, `text`, `swipe`, `fling`, `drag`, and `dircfling` route input to the display that owns the specified window. Use `ui window list --all` to get the current window ID and DisplayId. Click/doubleclick/longclick accept `--window` with coordinates, `--id`, or `--selector`; `text` also accepts it alone for focused input on its display. Secondary-display longclick uses the device default duration and rejects custom non-default `--duration` values. Coordinates are device pixels in the target display coordinate system—host-window offsets and previewer/screenshot scaling are not converted. Without `--window`, raw coordinates and focused text use the primary display; selectors use the focused window. Node-ID lookup searches all displays and requires a unique match, so specify `--window` when multiple previewers contain the same ID. Element-mode swipe/drag endpoints must be on the same display. Re-query the current app window after every previewer restart; never reuse stale window/display IDs.
|
|
368
|
+
- **Device capability for secondary-display input**: The device-side `uitest` must accept a trailing `[displayId]` for the target subcommand. Support varies by device system version, and some versions reject the appended display argument. Check `uitest uiInput help` on the device and confirm that the target subcommand lists `[displayId]`; otherwise upgrade or use a supporting system.
|
|
369
|
+
- **Selector DSL**: `key op value` clauses, `,`-separated for AND, `[n]` for index. Operators: `=` (exact), `*=` (contains), `^=` (prefix), `$=` (suffix), `/=` (regex). Also supports `xpath=` prefix for XPath 1.0 expressions and `base64=` prefix to escape shell/DSL special characters. Duplicate property keys (including `desc`/`description` aliases) are rejected.
|
|
370
|
+
- **`swipe`/`drag` element mode**: `--start <expr> --end <expr>` resolves each selector to bounds center, then performs the swipe/drag. Both must be provided together.
|
|
371
|
+
- **`find`/`wait`**: `find` polls the UI tree every 300ms until a match is found or `--timeout` expires. `wait` without a selector is a pure sleep; with a selector, polls for appearance (default) or disappearance (`--disappear`).
|
|
372
|
+
- **`swipe` vs `dircfling`**: `swipe` requires exact start/end coordinates (or `--start`/`--end`) and supports `--speed`; `dircfling` only needs a direction (`up/down/left/right`) and uses system default speed (ideal for page/list scrolling).
|
|
373
|
+
- **`scrollsearch`**: The target `<selector>` does not support an index (`[n]`); passing one triggers an error.
|
|
374
|
+
- **Text encoding**: Special characters in `text` are Base64-encoded internally to safely pass through device shell.
|
|
375
|
+
- `--format json` pairs well with `jq`.
|
|
376
|
+
- `--mode full`: full layout tree, no filtering.
|
|
377
|
+
- `--mode simplified` (default): folds meaningless wrapper containers (non-root, no `id`, no text, not interactive) by lifting their surviving children up. `--depth` truncates after folding.
|
|
378
|
+
|
|
379
|
+
**UI verification loop (预览器截图 / 视觉走查 / 截图验证)** — for verifying UI changes or capturing what the app looks like on any hdc target: a real device or emulator on every host, or the DevEco Studio **previewer** on HarmonyOS native (2in1) PC. One round: build → (re)deploy or refresh the target → screenshot → evaluate → fix → repeat, one fresh screenshot per round, until every intended change is individually confirmed to have taken effect. On the HarmonyOS PC the Studio previewer (多设备预览器) is a local system app that renders the project on a **virtual display** visible to `ui display list` and capturable with `ui screenshot --display`; on Windows/macOS/Linux there is no capturable previewer — the IDE's embedded previewer is a local desktop process, not an hdc target — use the device/emulator loop. For on-device functional UI testing use `devecocli verify`.
|
|
380
|
+
|
|
381
|
+
**Real device or emulator** (any host):
|
|
382
|
+
1. `devecocli run` — builds, installs, and launches in one command (auto-selects a single connected target; `--device <name|serial>` when several)
|
|
383
|
+
2. `devecocli ui screenshot --path <existing-dir>/<fresh-name>.png` — captures the main screen by default; `--display <displayId>` targets a specific display (ids from `devecocli ui display list`). The destination directory must already exist and existing files are never overwritten — use a new file name each round.
|
|
384
|
+
|
|
385
|
+
**DevEco Studio previewer** (HarmonyOS PC only):
|
|
386
|
+
1. `devecocli build`
|
|
387
|
+
2. Start/refresh the previewer in DevEco Studio — this CLI has no previewer launch command.
|
|
388
|
+
3. Self-connect hdc to the local machine if not already connected: `hdc tconn 127.0.0.1:<port>` (port from Settings → System → Developer options → Wireless debugging).
|
|
389
|
+
4. Resolve the previewer's virtual display id: `devecocli ui display list` — display `0` is the main screen; the previewer appears as an extra entry.
|
|
390
|
+
5. Capture it: `devecocli ui screenshot --display <virtualDisplayId> --path <existing-dir>/<fresh-name>.png`.
|
|
391
|
+
|
|
392
|
+
**Virtual display id rules** (previewer loop): ids are dynamically assigned — re-query `ui display list` after **every** previewer restart; never reuse an earlier id. Restarts also leave old virtual displays **lingering**, so the list accumulates stale ids (e.g. `1005/1006/1007`). The authoritative id is the **DisplayId of the app's window** in `devecocli ui window list --all` — the window named after the app (e.g. `myapplication0`), newest pid; IDE windows (`devecostudio0/1`) sit on display `0`. If the installed CLI has no `display` subcommand, take the app window's DisplayId column from `ui window list --all` directly.
|
|
393
|
+
|
|
394
|
+
**Screenshot evaluation calibration**: text content, element presence, and relative before/after changes are reliable; **absolute position/alignment claims are not** — evaluators routinely misreport centered content as "offset". Derive position and color facts from pixels (Node's built-in zlib can decode the PNG; a non-background bounding-box center ≈ (50%, 50%) means centered) and let pixel data override conflicting evaluator claims.
|
|
395
|
+
|
|
396
|
+
*Ex*: `devecocli ui display list` → `devecocli ui screenshot --display 1005 --path ./shots/round1.png` (directory already exists; new file name per round)
|
|
397
|
+
|
|
398
|
+
### `devecocli testing` `[Outside sandbox]`
|
|
399
|
+
|
|
400
|
+
Run DevEco Testing detection services on a connected device.
|
|
401
|
+
|
|
402
|
+
| Sub-command | Parameters |
|
|
403
|
+
|---|---|
|
|
404
|
+
| `list` | — (`ServiceKey`, `Status`) |
|
|
405
|
+
| `install` | `--service <serviceKey>` |
|
|
406
|
+
| `update` | `--service <serviceKey>` |
|
|
407
|
+
| `run <serviceKey>` | `--package <bundleName>`, `--sn <serial>` (one serial only), `--yes`, plus the service's own flags (`--help` lists them) |
|
|
408
|
+
| `stop` | `--task-id <taskId>` |
|
|
409
|
+
| `userinfo`, `exit` | — |
|
|
410
|
+
| `help` | — (answered locally by devecocli; no client install needed) |
|
|
411
|
+
|
|
412
|
+
```powershell
|
|
413
|
+
devecocli testing list
|
|
414
|
+
devecocli testing install --service MemLeakTest
|
|
415
|
+
devecocli testing update --service MemLeakTest
|
|
416
|
+
devecocli testing run StandardTest --package com.example.myapp --sn <serial> --type performance,stability --performance-test-duration 10 --stability-test-duration 10 --yes
|
|
417
|
+
devecocli testing run MemLeakTest --package com.example.myapp --sn <serial> --duration 10 --yes
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
- **Parameters**: `--help` on `testing run <serviceKey>` lists that service's flags — read it before choosing any. 上架预检 `StandardTest` is one service with several sub-items: `--type` picks them, each with its own duration, so always state which sub-items you run.
|
|
421
|
+
- **Device**: `--sn` must be one the user confirmed; with several connected (`devecocli device list`) ask which and wait — never default to the first.
|
|
422
|
+
- **Client**: `DEVECO_TESTING_HOME` may point to the installation root, `bin`, or the launcher, and pins that client. Without it, devecocli auto-detects installations; if several are found and stdin is not a TTY, it fails and requires the variable rather than guessing. Use DevEco Testing's own java, never a java from `PATH`.
|
|
423
|
+
- **Progress**: run `testing run` through the globally installed CLI (`& "$env:APPDATA\npm\devecocli.cmd"` / `"$(npm prefix -g)/bin/devecocli"`) so output streams.
|
|
424
|
+
- **Result**: the run ends with `[REPORT] 报告已生成: <dir>`; read `<dir>/export/2d_report_data.json` (`isTaskPass`, `expandData[].resultSummary`, `expandData[].resultDetails[].status`) or `export/Task-*.html` — never print the JSON. No `2d_report_data.json` → `<dir>/report/<taskId>_report.json` (`taskResult.taskPass`). Exit code is `0` even on failure, so read `[ERROR]` / `[SUGGEST]`.
|
|
425
|
+
|
|
426
|
+
### `devecocli profiler`
|
|
427
|
+
Cold-start performance profiling. `record app-launch` records a cold launch on a device (Trace / Perf / RedundantFile); `analyze` subcommands analyze the recorded artifacts by dimension and `performance` subcommands provide scene/phase queries — both print the profiler backend's JSON envelope (`{code, message, data, requestId, costMs}`) **verbatim**: `devecocli` never reshapes, retypes or trims it, so field names and units always follow the backend. A non-zero backend exit code (0 ok / 2 usage / 3 input / 4 analysis / 5 not found) becomes the command's exit code. `app-stop` force-stops a target app on a device and `version` prints the backend jar version. Requires the Command Line Tools toolchain — set `DEVECO_CLI_CLT_PATH` when DevEco Studio is detected (the profiler command group — version check, recording device discovery, and the bridge process — uniformly prefers the CLT from `DEVECO_CLI_CLT_PATH` even when `DEVECO_CLI_STUDIO_PATH` is set). Analysis-window timestamps are in nanoseconds.
|
|
428
|
+
|
|
429
|
+
| Subcommand | Description | Key Options |
|
|
430
|
+
|---|---|---|
|
|
431
|
+
| `version` | Print the backend jar's version and build time — use it to confirm which build is actually deployed (the version number often stays the same) | — |
|
|
432
|
+
| `app-stop` | Force-stop a running application on a device via `aa force-stop` | Req `--bundle <name>`; Opt `--device <name\|serial>` (Req on multi-device hosts) |
|
|
433
|
+
| `record app-launch` | Record one cold launch, producing Trace / Perf / RedundantFile files with per-file status | Req `--bundle <name>`, `--output <dir>`; Opt `-t, --time <seconds>` (default `20`), `--device <name\|serial>` (Req on multi-device hosts) |
|
|
434
|
+
| `analyze high-cost-function` | Find CPU sampling hotspots of one thread within explicit time windows (leads, not root-cause evidence) | Req `--input <perf .data/.insight>`, `--pid`, `--tid`, `--start <ns>`, `--end <ns>`; Opt `--top <n>` (default `10`, 1-100) |
|
|
435
|
+
| `analyze main-thread-blocking` | Attribute main-thread blocking to async wakeup threads per frame window (not the main thread itself being slow) | Req `--input <.htrace>`, `--pid`, `--start <ns>`, `--end <ns>`; Opt second `--input <perf .data/.insight>`, `--min-idle <ns>`, `--top <n>` |
|
|
436
|
+
| `analyze network-optimization` | List slow requests within the launch window with optimization candidates (no automatic changes) | Req `--input <.htrace>`, `--pid`, `--start <ns>`, `--end <ns>`; Opt `--min-duration <ns>` (default `0`), `--top <n>` (default `10`) |
|
|
437
|
+
| `analyze component-complexity` | Locate component create/update hotspots and structure complexity per frame window | Req `--input <.htrace>`, `--pid`, `--start <ns>`, `--end <ns>`; Opt `--top <n>` |
|
|
438
|
+
| `analyze module-import` | Identify ETS/SO loads that could be deferred from a RedundantFile | Req `--input <RedundantFile .json/.txt>`; Opt `--top <n>` (default `20`) |
|
|
439
|
+
| `performance scene-reconstruction` | Enumerate apps and launch scenes in a trace with time and process context | Req `--input <.htrace>`; Opt `--bundle <name>`, `--scene-type launch` (default `launch`) |
|
|
440
|
+
| `performance launch-phases` | Query sub-phases of a selected cold launch, sorted to prioritize analysis | Req `--bundle <name>`, `--pid`, `--start <ns>`, `--end <ns>`, `--input <.htrace>` |
|
|
441
|
+
|
|
442
|
+
- **Typical flow**: `record app-launch` → `scene-reconstruction` (locate the launch scene and time window) → `launch-phases` (phase breakdown) → dimension-specific analysis with `--pid --start --end`. Scene items carry `start` / `end` / `duration` straight from the backend (current builds emit integer **nanoseconds**, the same unit analysis commands accept) — trust the response, not this note, since field names and units follow the backend.
|
|
443
|
+
- **Multiple inputs**: only `main-thread-blocking` accepts a second file, passed by repeating the flag (`--input <a> --input <b>`, at most 2 files). All other analysis commands take exactly one `--input <file>`.
|
|
444
|
+
*Ex*: `devecocli profiler record app-launch --bundle com.example.app --output ./launch-data -t 30`
|
|
445
|
+
*Ex*: `devecocli profiler performance launch-phases --bundle com.example.app --pid 12345 --start 1000000000000 --end 1100000000000 --input ./launch-data/app.htrace`
|
|
446
|
+
|
|
447
|
+
## 2. Setup
|
|
448
|
+
|
|
449
|
+
### Agent Plugins
|
|
450
|
+
|
|
451
|
+
When this skill is provided by an agent plugin, follow its injected Runtime guidance for CLI selection, installation and updates. Plugin commands are available only in that environment; standalone CLI users follow the setup commands below.
|
|
452
|
+
|
|
453
|
+
### `devecocli init`
|
|
454
|
+
MUTUALLY EXCLUSIVE modes for setup:
|
|
455
|
+
1. `--skill` (Default): Install all bundled skills (`deveco-cli`, `hmos-arkui-develop-skill`, `hmos-dfx-analyzer`) to AI agents; each skill is linked into the agent skill paths pointing to the CLI package.
|
|
456
|
+
2. `--mcp`: Configure `deveco-mcp` server (ArkTS/C++ syntax checking).
|
|
457
|
+
*Options*:
|
|
458
|
+
- `--agent <agents>`: Comma-separated (e.g. `opencode,pi,cursor`). Defaults to detected agents.
|
|
459
|
+
- `--project <path>`: Project-level config (Abs path for MCP).
|
|
460
|
+
- `--path <path>`: Direct skill install path; cannot combine with `--agent`, `--project` or `--mcp`.
|
|
461
|
+
- `--with-homegraph`: With `--mcp` only. Also install the `homegraph` CLI and write a sibling `homegraph` MCP entry; records an opt-in marker so `devecocli update` can upgrade it later. Errors if used without `--mcp`.
|
|
462
|
+
*MCP Rules*: Configured MCP agents support global (no `--project`) and project-level setup; `qoder` is unsupported.
|
|
463
|
+
*Skill agents*: See README.md, “`init` 支持的 Skill 安装目标”. If an agent is not detected, specify `--agent`.
|
|
464
|
+
|
|
465
|
+
**Existing Skill paths and MCP entries are skipped by default. To update them or convert copied Skill installations to symlinks, rerun `devecocli init -f` (or `--force`); old content and local edits will be deleted.** This flag also allows missing target directories to be created. Correct links are kept and follow CLI updates; failed linking falls back to copying. `skills remove` rejects bundled skill names and never touches the npm package. Bundled skills newly added by a CLI upgrade are installed by rerunning `devecocli init` (already-installed links follow package updates automatically).
|
|
466
|
+
|
|
467
|
+
### `devecocli auth login`
|
|
468
|
+
Sign in to your Huawei Developer account. Opens a browser for OAuth authentication. Required before `signature generate`. On an interactive terminal it waits for Enter before opening the browser; pass `--no-prompt` to open it immediately (also auto-skipped when stdin is not a TTY).
|
|
469
|
+
For login and CLI/runtime installation, use existing user authorization from the conversation and ask only if it is missing. Once login is authorized, run `devecocli auth login --no-prompt` directly instead of asking the user to run it in a terminal. The user still completes authentication in the browser; `--no-prompt` only skips the terminal Enter confirmation.
|
|
470
|
+
*Ex*: `devecocli auth login --no-prompt`
|
|
471
|
+
|
|
472
|
+
### `devecocli auth logout`
|
|
473
|
+
Sign out and clear locally stored credentials.
|
|
474
|
+
|
|
475
|
+
### `devecocli auth status`
|
|
476
|
+
Show the current logged-in user.
|
|
477
|
+
|
|
478
|
+
### `devecocli auth team list`
|
|
479
|
+
List team accounts the current user has joined.
|
|
480
|
+
|
|
481
|
+
### `devecocli skills`
|
|
482
|
+
The skills command manages HarmonyOS skills for AI agents and projects, supporting listing, keyword search, installation and uninstallation. Use this tool when you need to view, search, add or remove HarmonyOS skills bound to AI agents or projects.
|
|
483
|
+
- `list [-l|--long]` / `find <keyword>`: List or search skills; bundled skills are shown first with the `[built-in]` marker and remain visible when the marketplace is unreachable.
|
|
484
|
+
- `add (--all | --skill <name>) [--agent <a,b…>] [--project <path>] [--path <path>] [-f]`: Install. A `--skill` name that is bundled in `packages/cli/skills` is rejected — use `devecocli init` (those skills update with the CLI package). `--all` installs marketplace skills only. (`hmos-design2arkts`, shipped with the design2arkts engine, is the exception: it is bundled but installed on demand through `add`.)
|
|
485
|
+
- `remove --skill <name> [...]`: Uninstall (marketplace skills; names bundled in `packages/cli/skills` are rejected — they follow the CLI package). `-f` also removes modified managed Skills, deleting their local edits.
|
|
486
|
+
- Ordinary project paths such as `skills/` and `data/` require an explicit `--agent` for installation or removal; automatic selection ignores them.
|
|
487
|
+
A minimum set is bundled with the CLI and installed by `devecocli init`: `hmos-arkui-develop-skill` (ArkTS red-line rules, fatal pitfalls + accurate API entry) and `hmos-dfx-analyzer` (DFX fault triage: input normalization, deterministic fault classification and routed analysis for crashes, freezes and faultlogs) — covering pre-coding constraints and fault diagnosis.
|
|
488
|
+
|
|
489
|
+
Routing: load `hmos-arkui-develop-skill` before writing or modifying `.ets` UI code, `hmos-dfx-analyzer` for fault analysis (crash/freeze/ANR, CppCrash, JSCrash, AppFreeze, faultlogs), and use `deveco-cli` commands for build/run/device/log work. `hmos-one-sdk-skill` is not bundled with the CLI; install it on demand with `devecocli skills add --skill hmos-one-sdk-skill`.
|
|
490
|
+
|
|
491
|
+
**Existing Skill paths are skipped by default. Use `-f` / `--force` to replace them, deleting old content and local edits. To convert copied agent installations to symlinks, rerun `devecocli init -f` for bundled skills or `devecocli skills add --skill <name> -f` for other Skills.** This flag also allows missing target directories to be created. Correct links are kept; failed linking falls back to copying. Batch installation continues after failures, prints a summary and exits nonzero if any Skill fails.
|
|
492
|
+
|
|
493
|
+
Extracted skills are stored in <CLI data directory>/skills/store/<name> globally or <project>/.deveco-cli/skills/store/<name> per project (consider ignoring .deveco-cli/skills/ in version control). Agent skill entries like .agents/skills/<name> link directly to this store, reusing existing files for new Agents. Bundled skills skip the store: their agent entries link directly into the CLI package, so they update with `npm update` of the CLI. Note that -f updates affect every linked Agent in that scope.
|
|
494
|
+
|
|
495
|
+
*Ex*: `devecocli skills add --skill <name> --agent opencode --project ./MyApp`
|
|
496
|
+
|
|
497
|
+
### `devecocli plugin`
|
|
498
|
+
Manage whitelisted npm-packaged AI agent plugins (official registry only; the whitelist `npmPackage` coordinate may carry a `@tag` suffix to select a dist-tag, e.g. `@scope/pkg@cli` — defaults to `latest`).
|
|
499
|
+
- `list [-l|--long]`: List whitelisted plugin names, one per line (matching `skills list`); `--long` appends each plugin's description.
|
|
500
|
+
- `install <name> [--agent <a,b…>] [--project <path>] [-f]`: Download the package into the CLI data directory, then run the plugin's `install` hook per target agent (detected agents ∩ plugin `supportedAgents`; a plugin omitting `supportedAgents` defaults to all known agents, while an explicitly empty/unknown list fails contract validation). `--force` runs the previous version's `uninstall` hook first. With an explicit `--agent` plus `--project`, missing target skills dirs (including the `.<agent>` root) are created before hooks run, matching `init --project --agent`.
|
|
501
|
+
- `update <name> [--agent <a,b…>] [--project <path>]`: Fetch the latest version and run the `update` hook (`from`/`to` provided; `from` is the highest pre-download store version — `from === to` means no local version or latest already cached, treat as repair/first install). With an explicit `--agent` plus `--project`, missing target skills dirs (including the `.<agent>` root) are created before hooks run, same as `install`.
|
|
502
|
+
- `uninstall <name> [--agent <a,b…>] [--project <path>]`: Run the `uninstall` hook of the highest loadable local version. Never deletes cached packages (`<dataDir>/plugins/store/<name>/`) or plugin data (`<dataDir>/plugins/data/<name>/`); remove those manually if needed.
|
|
503
|
+
- Hook execution is capped at 120s (override with `DEVECO_CLI_PLUGIN_HOOK_TIMEOUT_MS`).
|
|
504
|
+
|
|
505
|
+
*Ex*: `devecocli plugin install example-plugin --agent opencode --project ./MyApp`
|
|
506
|
+
|
|
507
|
+
### `devecocli check compat` `[Outside sandbox]`
|
|
508
|
+
Scan source code for breaking API changes between two SDK versions. Built on top of DevEco Studio's `arkanalyzer-apiscan` plugin (Studio ≥ 26.0.0.810) or Command Line Tools' `apicompat` component (CLT ≥ 26.0.1). On Linux, CLT is required.
|
|
509
|
+
- `versions`: List available target SDK versions. Opts: `--format <default|json>` (default: `default`).
|
|
510
|
+
- Default (no args): project-level scan.
|
|
511
|
+
- `--modules <m1> [m2...]`: Module-level scan.
|
|
512
|
+
- `<file1> [file2...]`: File-level scan (`.ets`/`.c`/`.cpp` only).
|
|
513
|
+
- `--source-version <v>` (Req) / `--target-version <v>` (Req): SDK version pair. Run `devecocli check compat versions` first; on zsh, **quote the value** (e.g. `"<source_version>"`, `"<target_version>"`).
|
|
514
|
+
- `--format <default|csv|json>` (default: `default`): Console output accepts `default` (text) or `json`; file output (via `--output-path`) accepts `default` (csv), `csv`, or `json`. `csv` requires `--output-path`.
|
|
515
|
+
- `--output-path <path>`: Directory (writes `apiChange-*.csv`/`apiChange-*.json`) or explicit file (extension must match `--format`).
|
|
516
|
+
- `--limit <n>` (default `100`): Max records shown on console when no `--output-path`.
|
|
517
|
+
|
|
518
|
+
Validation order: `files` + `--modules` mutually exclusive → `--source-version`/`--target-version` required → `csv` requires `--output-path` → project dir valid → modules exist → files exist + extension valid → versions in catalog + `target > source` → format/extension match → output target writable.
|
|
519
|
+
|
|
520
|
+
*Ex*: `devecocli check compat --source-version "<source_version>" --target-version "<target_version>" --output-path ./report`
|
|
521
|
+
|
|
522
|
+
### `devecocli design2arkts` (alias: `d2a`)
|
|
523
|
+
|
|
524
|
+
Use `devecocli d2a --help` for Pixso/Figma design-to-ArkTS workflows and standalone capabilities accepting local images or code without a prior D2A run.
|
|
525
|
+
|
|
526
|
+
Solution design supports UI pages only; repository analysis covers the target page and its dependencies. The Pixso workflow proceeds from repository understanding to page design. Follow the Controller-returned stage IDs; they are not guaranteed to be consecutive.
|
|
527
|
+
|
|
528
|
+
Submit every workflow stage with `devecocli d2a stage-complete --run-dir <runDir> --stage <N> --result passed|blocked [--reason-code <code>]`: it delegates to the same Controller (identical output and exit code) and reports one event per submission — a delivery event for a first-time final completion, a stage-failure event for `blocked` or a non-zero exit. `init`, `status`, `stage-start` and `confirm` still call the Controller script directly.
|
|
529
|
+
|
|
530
|
+
## 3. Maintenance
|
|
531
|
+
|
|
532
|
+
- **`devecocli update`** `[Outside sandbox]`: Update CLI to latest version. npm always runs in global-config mode (`NPM_CONFIG_LOCATION=global`): the project `.npmrc` never applies to the update chain (registry/proxy/CA come from user-level config only); mirrors must be configured in the user-level `~/.npmrc`.
|
|
533
|
+
- **`devecocli serve mcp`**: Host stdio MCP server (`check` tool for `.ets`/C/C++). Used via `init --mcp`. (Env: `PROJECT_PATH`, `DEVECO_PATH`, `NODE_MAX_OLD_SPACE_SIZE`, `DEBUG=1`).
|
|
534
|
+
- **`devecocli serve lsp`**: Host a bundled stdio **LSP** language server — `--arkts` (ArkTS, ace-server) or `--cpp` (clangd). Standard LSP protocol: completion, go-to-definition, hover, references, diagnostics. Opts: `--project-path <path>` (used as-is), `--auto-detect` (search cwd and subdirs for project root; ignored when `--project-path` given).
|
|
535
|
+
- Agents/editors with a built-in LSP client drive it directly — e.g. **opencode** (`lsp` config in `opencode.json`), **Zed**, **Neovim**, **VS Code**, **Emacs**:
|
|
536
|
+
`"lsp": { "ArkTS": { "command": ["devecocli", "serve", "lsp", "--arkts"], "extensions": [".ets"] } }`
|
|
537
|
+
- MCP-only agents (no LSP client) can bridge via [agent-lsp](https://github.com/blackwell-systems/agent-lsp), an MCP server that wraps any stdio LSP. MCP command: `["agent-lsp", "ets:devecocli,serve,lsp,--arkts"]`.
|
|
538
|
+
- **`serve lsp` is a long-running stdio server, not a shell command — never execute it directly.** Look up how the target agent registers a custom LSP server in its own documentation, then plug in the commands above.
|
|
539
|
+
- **Never wire `serve lsp` and `serve mcp` into the same agent.** Each spawns its own ace-server/clangd, so running both doubles memory. Pick one: direct LSP or MCP — **prefer MCP** (simpler to integrate, initialization built in).
|
|
540
|
+
|
|
541
|
+
## Recipes
|
|
542
|
+
|
|
543
|
+
- **Fresh checkout to emulator**:
|
|
544
|
+
`devecocli build` -> `devecocli emulator list` -> `devecocli emulator start "Name"` -> `devecocli run`
|
|
545
|
+
If `emulator start` fails, read stderr for diagnostics from each launch attempt in order.
|
|
546
|
+
- **Diagnose crash**:
|
|
547
|
+
`devecocli log --crash --bundle-name <bundle>` (device), or `devecocli log --crash --path <faultlog file|dir> --format report` (local analysis), or `devecocli log --stack --path <sample_stacks file>` (freeze hotspot analysis)
|
|
548
|
+
- **Verify UI changes with screenshots (视觉走查)**:
|
|
549
|
+
`devecocli run` -> `devecocli ui screenshot --path <existing-dir>/<fresh-name>.png` -> evaluate & fix -> repeat
|
|
550
|
+
Previewer variant (HarmonyOS PC only): refresh the previewer in DevEco Studio (`hdc tconn 127.0.0.1:<port>` first) -> `devecocli ui display list` (re-query after every previewer restart) -> `devecocli ui screenshot --display <id> --path <existing-dir>/<fresh-name>.png` -> repeat
|
|
551
|
+
- **Release build**:
|
|
552
|
+
`devecocli build --product oversea --build-mode release`
|
|
553
|
+
- **First-time signing setup** (login authorized; user completes browser authentication):
|
|
554
|
+
`devecocli auth login --no-prompt` -> `devecocli signature generate --product default` -> `devecocli build` -> `devecocli run`
|
|
555
|
+
- **One-sentence detection run** (e.g. "测试商城应用内存泄漏"):
|
|
556
|
+
read `AppScope/app.json5` for the bundle name and `devecocli device list` for the serial ->
|
|
557
|
+
`devecocli testing list` -> `devecocli testing install --service MemLeakTest` if `Not installed` ->
|
|
558
|
+
`devecocli testing run MemLeakTest --package <bundleName> --sn <serial> --duration 240 --yes` -> summarize `[REPORT]`
|
|
559
|
+
|
|
560
|
+
## Troubleshooting
|
|
561
|
+
|
|
562
|
+
- **"Product / Build mode `<x>` not found"**: Check `build-profile.json5`.
|
|
563
|
+
- **"Multiple entry modules" / "No entry module"**: Pass `--modules` (build) or `--module` (run).
|
|
564
|
+
- **"No active devices" / "Multiple devices connected"**: Connect/start emulator. Pass `-t <serial>` (device view) or `--device <name|serial>` (run/log).
|
|
565
|
+
- **`error:install sign info inconsistent`**: Signing key changed. Run `devecocli run --uninstall` or `devecocli signature generate --force`.
|
|
566
|
+
- **`Not logged in. Run devecocli auth login first`**: Run `devecocli auth login --no-prompt` with login authorization (see Setup).
|
|
567
|
+
- **`Provision number exceeds limit`**: Test provision quota is full. Delete old test provisions in DevEco Studio (Signing Configs) or AGC console, then retry `devecocli signature generate`.
|
|
568
|
+
- **`Invalid AccessToken. Sign in and try again`**: Token expired. Run `devecocli auth login --no-prompt` with login authorization (see Setup).
|
|
569
|
+
- **Invalid Skill agent**: Use an ID from the README supported-agent list.
|
|
570
|
+
- **`emulator start` / `image download` blocked on agreement**: Follow `emulator license accept` above: use existing agreement acceptance authorization, ask only if missing, and run `devecocli emulator license accept`. Resume the blocked operation only after acceptance succeeds.
|
|
571
|
+
- **`image download` failure / timeout**: Do NOT auto-retry. Give the command to the user to run manually in their terminal.
|
|
572
|
+
- **`emulator create` timeout**: Treat as user-action step. Ask user to open DevEco Studio -> Device Manager. Check `emulator list` after user confirms. Do NOT auto-retry or edit SDK files.
|
|
573
|
+
- **`image list` duplicate OS rows**: `phone`/`foldable`/`widefold`/`triplefold` share the same image. Download/remove ONCE per OS version.
|
|
574
|
+
- **`ui layout` missing expected node**: `layout` only returns on-screen nodes. Use `devecocli ui dircfling <direction>` or `devecocli ui swipe <x1> <y1> <x2> <y2>` to scroll the target into view, then retry `ui layout`. Specify `--device <name|serial>` when multiple devices are connected.
|
|
575
|
+
- **`未找到 DevEco Testing 安装` / `… 安装不完整`**: The variable must point at a complete install root — the client with its bundled java. Ask the user for the right root; the CLI names what is missing and never falls back to another install.
|
|
576
|
+
- **`未找到 DevEco Testing 启动脚本 DevEcoTestingCli`**: The directories listed in the message have no CLI launcher — either `DEVECO_TESTING_HOME` points at the wrong location, or the installed client is a legacy version without a CLI. Have the user check the listed directories, then point the variable at the new client or install the latest DevEco Testing from the download page in the message.
|
|
577
|
+
- **`当前 DevEco Testing 版本不支持 testing`**: The installed client is too old. Run `devecocli testing update`, then retry.
|
|
578
|
+
- **`[ERROR] 前置确认未通过`**: `run` hit the confirmation prompt in a non-interactive shell. Add `--yes`.
|
|
579
|
+
- **Testing client starts but fails, or another JDK wins**: Always go through `devecocli testing` — it runs the java bundled next to the client's launcher (`bin/java`, `bin\java.exe` on Windows); never call the launcher script directly.
|
|
580
|
+
- **`run` killed mid-test**: The bash timeout was shorter than the test. Re-run with a longer timeout; a killed run produces no report.
|
|
581
|
+
- **"CLI online services are not available in your region"**: Cloud-service commands (login/signature/agreement, `skills list/find/add`) abort when the region is outside the CN/HK/MO whitelist; local-only commands (`create`/`build`/`device`, `skills remove`/`init`) and already-installed skills are unaffected. login/signature/agreement additionally depend on GRS: they also abort when GRS is unreachable or has no config for the region — suggest checking `HTTP_PROXY`/`HTTPS_PROXY`. GRS verifies server certificates on every connection, proxied or not — a proxy that re-signs TLS (corporate inspection) fails closed unless its CA is listed in a `NODE_EXTRA_CA_CERTS` PEM file. Use `DEVECO_CLI_DEBUG=1` to inspect country-code detection and GRS resolution. Telemetry is CN-only (silently disabled elsewhere).
|
|
582
|
+
- **"Marketplace unavailable"** (`skills list`/`find`): The skills marketplace is a fixed address (`matrix.openharmony.cn`), not resolved via GRS. When the market request fails, both commands warn and fall back to bundled-only output, exiting 0; `skills add` of a marketplace skill fails instead. Already-installed skills keep working.
|