@deveco/deveco-cli-common 1.3.10 → 1.3.12
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 -21
- package/README.md +2735 -1916
- package/THIRD-PARTY-LICENSES +76 -46
- package/dist/cli.js +258 -158
- 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 +176 -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 +164 -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 +350 -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 +94 -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 +92 -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 +43 -0
- package/dist/design2arkts-engine/resources/skill/references/figma/fast/stages/05-summary.md +36 -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 +219 -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 +28 -0
- package/dist/design2arkts-engine/resources/skill/references/figma/full/stages/05-visual-calibration.md +190 -0
- package/dist/design2arkts-engine/resources/skill/references/figma/full/stages/06-summary.md +29 -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 +245 -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 +343 -0
- package/dist/design2arkts-engine/resources/skill/references/pixso/fast/stages/09-summary.md +103 -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 +245 -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 +343 -0
- package/dist/design2arkts-engine/resources/skill/references/pixso/full/stages/09-visual-calibration.md +190 -0
- package/dist/design2arkts-engine/resources/skill/references/pixso/full/stages/10-summary.md +105 -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 +435 -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 +3672 -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 +44 -7
- package/package.json +81 -71
- package/skills/deveco-cli/SKILL.md +494 -335
- 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 +683 -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/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 +373 -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 +112 -0
- package/skills/hmos-dfx-analyzer/test-cases/smoke.md +86 -0
- package/skills/hmos-dfx-analyzer/test-cases/test-prompts.md +35 -0
- package/skills/hmos-dfx-analyzer/test-cases/trigger.md +121 -0
- package/skills/index.json +17 -0
- package/src/resources/aclPermission/aclPermissionsInfo.json +310 -310
- package/src/resources/arkts-check.cjs +3833 -3671
- package/templates/application/AppScope/app.json5 +10 -10
- package/templates/application/AppScope/resources/base/element/string.json +8 -8
- package/templates/application/AppScope/resources/base/media/layered_image.json +6 -6
- package/templates/application/build-profile.json5 +41 -41
- package/templates/application/code-linter.json5 +31 -31
- package/templates/application/entry/build-profile.json5 +32 -32
- package/templates/application/entry/gitignore.txt +5 -5
- package/templates/application/entry/hvigorfile.ts +7 -7
- package/templates/application/entry/obfuscation-rules.txt +19 -19
- package/templates/application/entry/oh-package.json5 +10 -10
- package/templates/application/entry/src/main/ets/entryability/EntryAbility.ets +62 -62
- package/templates/application/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +30 -30
- package/templates/application/entry/src/main/ets/pages/Index.ets +37 -37
- package/templates/application/entry/src/main/module.json5 +49 -49
- package/templates/application/entry/src/main/resources/base/element/color.json +7 -7
- package/templates/application/entry/src/main/resources/base/element/float.json +8 -8
- package/templates/application/entry/src/main/resources/base/element/string.json +15 -15
- package/templates/application/entry/src/main/resources/base/media/layered_image.json +6 -6
- package/templates/application/entry/src/main/resources/base/profile/backup_config.json +2 -2
- package/templates/application/entry/src/main/resources/base/profile/main_pages.json +5 -5
- package/templates/application/entry/src/main/resources/dark/element/color.json +7 -7
- package/templates/application/gitignore.txt +12 -12
- package/templates/application/hvigor/hvigor-config.json5 +23 -23
- package/templates/application/hvigorfile.ts +7 -7
- package/templates/application/oh-package.json5 +10 -10
|
@@ -1,335 +1,494 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: deveco-cli
|
|
3
|
-
description: >-
|
|
4
|
-
Use 'devecocli' for HarmonyOS apps (scaffold, build, run, debug, devices, emulators, logs, docs, UI inspection, 鸿蒙开发文档, skills). Use it if workspace has build-profile.json5 or oh-package.json5, or user mentions HarmonyOS, 鸿蒙, DevEco, ArkTS, ArkUI, docs, 鸿蒙文档, 知识, 搜索, skills, UI, UI测试, 组件调试. If user explicitly specifies another tool, skill, or workflow, follow that choice; otherwise use 'devecocli'.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
- `--
|
|
21
|
-
- `--
|
|
22
|
-
- `--
|
|
23
|
-
- `--
|
|
24
|
-
|
|
25
|
-
*Ex*: `devecocli create --app-name MyApp --
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
|
32
|
-
|
|
33
|
-
|
|
|
34
|
-
| Specific
|
|
35
|
-
|
|
|
36
|
-
|
|
|
37
|
-
| Clean
|
|
38
|
-
|
|
39
|
-
- **
|
|
40
|
-
- **
|
|
41
|
-
- **
|
|
42
|
-
- **
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
-
|
|
55
|
-
- `--
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
-
|
|
63
|
-
- `license
|
|
64
|
-
- `
|
|
65
|
-
- `
|
|
66
|
-
- `
|
|
67
|
-
-
|
|
68
|
-
-
|
|
69
|
-
- `
|
|
70
|
-
- `
|
|
71
|
-
- `
|
|
72
|
-
- `
|
|
73
|
-
- `
|
|
74
|
-
-
|
|
75
|
-
-
|
|
76
|
-
- `
|
|
77
|
-
- `
|
|
78
|
-
- `image
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
-
|
|
85
|
-
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
- `
|
|
95
|
-
- `
|
|
96
|
-
- `
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
-
|
|
149
|
-
- `--
|
|
150
|
-
-
|
|
151
|
-
-
|
|
152
|
-
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
- `--
|
|
171
|
-
- `--
|
|
172
|
-
- `--
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
-
|
|
180
|
-
-
|
|
181
|
-
- If
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
- `devecocli
|
|
185
|
-
- `
|
|
186
|
-
- `devecocli
|
|
187
|
-
- `
|
|
188
|
-
- `
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
-
|
|
195
|
-
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
- `
|
|
199
|
-
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
- `--
|
|
234
|
-
- `--
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
-
|
|
249
|
-
-
|
|
250
|
-
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
-
|
|
289
|
-
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
-
|
|
328
|
-
-
|
|
329
|
-
-
|
|
330
|
-
-
|
|
331
|
-
- **`
|
|
332
|
-
- **`
|
|
333
|
-
- **`
|
|
334
|
-
-
|
|
335
|
-
-
|
|
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测试, 组件调试. 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`, `update`, `device`, `emulator`, `ui`, `skills`, `log`, `verify`, `create`, `init`, `serve`, `docs`, `signature`, `auth`, `design2arkts` (alias `d2a`), `testing`.
|
|
13
|
+
|
|
14
|
+
**Sandbox Rule**: Commands tagged `[Outside sandbox]` must be run outside the sandbox.
|
|
15
|
+
|
|
16
|
+
## 1. Code → Build → Deploy → Run → Debug
|
|
17
|
+
|
|
18
|
+
### `devecocli create`
|
|
19
|
+
Scaffold a new HarmonyOS project.
|
|
20
|
+
- `--app-name <name>` (Req): 1–200 chars, `^[a-zA-Z][a-zA-Z0-9_]*$`
|
|
21
|
+
- `--project-path <path>`: Auto-created if omitted (`./<app-name>`). Must be empty if exists.
|
|
22
|
+
- `--bundle-name <bundle>`: Default `com.example.<appname-lowercase>`. 7–128 chars, ≥3 segments.
|
|
23
|
+
- `--api-level <level>`: int ≥17 (default: auto or 23).
|
|
24
|
+
- `--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.
|
|
25
|
+
*Ex*: `devecocli create --app-name MyApp --project-path ./CustomDir --api-level 23`
|
|
26
|
+
*Ex*: `devecocli create --app-name MyApp --device-types tablet`
|
|
27
|
+
|
|
28
|
+
### `devecocli build` `[Outside sandbox]`
|
|
29
|
+
Compile and package project/modules. (Defaults: `--product default`, `--build-mode debug`)
|
|
30
|
+
- **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.
|
|
31
|
+
| Goal | Command |
|
|
32
|
+
|---|---|
|
|
33
|
+
| Single-module / single-`entry` | `devecocli build` |
|
|
34
|
+
| Specific modules | `devecocli build --modules <m1> <m2>@<target>` |
|
|
35
|
+
| Whole product bundle (.app) | `devecocli build --product <name>` |
|
|
36
|
+
| Override signing config | `devecocli build --signing-config <name>` |
|
|
37
|
+
| Clean build outputs | `devecocli build clean` |
|
|
38
|
+
| Clean specific modules | `devecocli build clean --modules <m1> <m2>` |
|
|
39
|
+
- **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.
|
|
40
|
+
- **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.
|
|
41
|
+
- **Build artifacts**: on success, prints absolute paths of all produced `.hap`/`.hsp`/`.har`/`.app` files for direct use.
|
|
42
|
+
- **debugLine**: disabled by default. Pass `--debug-line` to build to forward `-p debugLine=true` to hvigor.
|
|
43
|
+
- **Signing config**: `--signing-config <name>` overrides the product's default signing config from `build-profile.json5`, enabling release builds with a release signing config.
|
|
44
|
+
|
|
45
|
+
### `devecocli check lint`
|
|
46
|
+
Run DevEco Code Linter checks for TS/ArkTS code.
|
|
47
|
+
- **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.
|
|
48
|
+
- `[path]`: File or directory to lint. Defaults to the project root from `build-profile.json5`, otherwise the current directory.
|
|
49
|
+
- Options: `--config-path <file>`, `--fix`, `--incremental`, `--product <name>`, `--format <default|json>`, `--output-path <path>`, `--limit <number>`.
|
|
50
|
+
- 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.
|
|
51
|
+
|
|
52
|
+
### `devecocli check arkts`
|
|
53
|
+
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.
|
|
54
|
+
- `[files...]`: Specific `.ets` files to check. Defaults to all `.ets` files in the project.
|
|
55
|
+
- `--fix`: Auto-fix high-confidence errors (e.g., missing `export` keywords) before reporting.
|
|
56
|
+
- `--project <path>`: Project root directory. Defaults to auto-detection from cwd via `build-profile.json5`.
|
|
57
|
+
|
|
58
|
+
*Ex*: `devecocli check arkts --fix entry/src/main/ets/pages/Index.ets`
|
|
59
|
+
|
|
60
|
+
### `devecocli emulator`
|
|
61
|
+
Manage local emulator instances and system images.
|
|
62
|
+
- **Studio requirement**: DevEco Studio `>= 6.1.0`.
|
|
63
|
+
- `license view`: Read agreement text without changes.
|
|
64
|
+
- `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.
|
|
65
|
+
- `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.
|
|
66
|
+
- `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).
|
|
67
|
+
- `stop <names...>`: Stop by name or serial (`127.0.0.1:<port>`).
|
|
68
|
+
- Scene control commands require Emulator 7.0 or later. Use `DEVECO_CLI_DEBUG=1` to inspect the underlying `Emulator` command mapping.
|
|
69
|
+
- `shake` / `power` / `rotate <left|right>` / `volume <up|down>` (Req: `--target <nameOrSerial>`): Basic emulator controls.
|
|
70
|
+
- `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.
|
|
71
|
+
- `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.
|
|
72
|
+
- `geolocation` (Req: `--target`; `--longitude`+`--latitude` recommended together, missing one warns only; Opt: `--altitude`, `--direction`): Inject GPS data (multiple options in one call).
|
|
73
|
+
- `scene <outdoorRunning|outdoorCycling|drivingNavigation>` (Req: `--target`): Start motion simulation.
|
|
74
|
+
- `sensor` (Req: `--target`; `--light-intensity`/`--humidity`/`--temperature`/`--steps`/`--heartrate`, multiple may be set in one call): Inject sensor data.
|
|
75
|
+
- 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.
|
|
76
|
+
- `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.
|
|
77
|
+
- `delete <name>`: Delete instance. Opt: `--instance-path <path>` (alias `--path`) — required to delete an instance created with a custom path.
|
|
78
|
+
- `image list`: List downloaded images. Opts: `--device-type <type>`, `--all`, `--format <table|json>`.
|
|
79
|
+
- `image download` / `image remove` (Req: `--device-type`, `--os-version`): Download/remove image. (Takes 30+ min, set long timeout).
|
|
80
|
+
*Device types*: `phone`, `foldable`, `widefold`, `triplefold`, `tablet`, `2in1`, `2in1 foldable`, `wearable`, `tv`.
|
|
81
|
+
|
|
82
|
+
### `devecocli ui`
|
|
83
|
+
Inspect UI on a connected physical device or running emulator.
|
|
84
|
+
- `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.
|
|
85
|
+
- Optional: `--display <displayId>`. Required: `--path <path>` (existing directory or PNG file path, including paths relative to the current directory; writable destination; no overwrite).
|
|
86
|
+
- Implementation uses `hdc shell snapshot_display` and `hdc file recv`; set `DEVECO_CLI_DEBUG=1` to inspect the actual `hdc` commands.
|
|
87
|
+
*Ex*: `devecocli ui screenshot --device Phone --path ./screenshots/phone.png`
|
|
88
|
+
|
|
89
|
+
`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.
|
|
90
|
+
*Ex*: `devecocli ui screenrecord start --device Phone --path ./recordings/` → `devecocli ui screenrecord stop --device Phone`
|
|
91
|
+
|
|
92
|
+
### `devecocli docs`
|
|
93
|
+
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.
|
|
94
|
+
- `search <keywords...>`: Match any keyword. Opts: `--catalog <name>`, `--format <default|json>`, `--limit <n>`.
|
|
95
|
+
- `read <documentId>`: Read full content by ID (e.g. `devecocli docs read guides/harmonyos-guides/指南/系统/网络/网络`).
|
|
96
|
+
- `catalog`: List available catalogs.
|
|
97
|
+
- `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`.
|
|
98
|
+
|
|
99
|
+
Always use this tool to get the most up-to-date information about HarmonyOS concepts.
|
|
100
|
+
|
|
101
|
+
### `devecocli device`
|
|
102
|
+
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).
|
|
103
|
+
|
|
104
|
+
| Subcommand | Description | Key Options |
|
|
105
|
+
|---|---|---|
|
|
106
|
+
| `list` | Show active real devices and running emulators | `--format table\|json` (default: `table`) |
|
|
107
|
+
| `view` | Detailed device info | `-t <name\|serial>` (Req on multi-device), `--format table\|json` (default: `table`) |
|
|
108
|
+
| `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...]` |
|
|
109
|
+
| `app install [files...]` | Install hap/hsp packages | `--replace` (overwrite), `--shared <path>` (HSP libs, repeatable), `--wait <seconds>` (180–600), `--user <userId>` |
|
|
110
|
+
| `app uninstall` | Uninstall app by bundle name | `--bundle <name>` |
|
|
111
|
+
| `app list` | List installed apps | `--format default\|json` |
|
|
112
|
+
| `app info <bundleName>` | Show app details | `--format default\|json` |
|
|
113
|
+
| `app foreground` | Show current foreground app | `--format default\|json` |
|
|
114
|
+
| `app start` | Launch app ability | `--bundle <name>`, `--ability <name>`, `--action <action>`, `--uri <uri>` |
|
|
115
|
+
| `app stop` | Force-stop app | `--bundle <name>` |
|
|
116
|
+
| `app cleardata` | Clear app data | `--bundle <name>` |
|
|
117
|
+
| `app clearcache` | Clear app cache | `--bundle <name>` |
|
|
118
|
+
| `wake` | Wake screen | — |
|
|
119
|
+
| `sleep` | Suspend screen | — |
|
|
120
|
+
| `status` | Show screen state (AWAKE/SLEEP) | — |
|
|
121
|
+
| `unlock` | Wake + swipe-up to unlock (phone/tablet only, not 2in1) | — |
|
|
122
|
+
| `open-control-center` | Swipe to open control center (phone/tablet only) | — |
|
|
123
|
+
| `open-notification-center` | Swipe to open notification center (phone/tablet only) | — |
|
|
124
|
+
| `time [datetime]` | Get (no arg) or set system time | `[datetime]` positional arg |
|
|
125
|
+
| `timezone [timezone]` | Get (no arg) or set system timezone | `[timezone]` positional arg |
|
|
126
|
+
| `screen size` | Get screen resolution | `--format default\|json` (json: `{width, height}`) |
|
|
127
|
+
| `screen rotation` | Get current screen rotation | — |
|
|
128
|
+
| `screen rotate <angle>` | Set screen rotation angle | `<angle>`: `0\|90\|180\|270` |
|
|
129
|
+
| `screen rotation-lock <state>` | Lock/unlock auto-rotate | `<state>`: `on\|off` |
|
|
130
|
+
| `screen sleeptime <ms>` | Set screen-off timeout | `<ms>`: timeout in ms; `-1` = never sleep |
|
|
131
|
+
| `file send <local> <remote>` | Push file to device | `<local>` source path, `<remote>` dest path |
|
|
132
|
+
| `file recv <remote> <local>` | Pull file from device | `<remote>` source path, `<local>` dest path |
|
|
133
|
+
| `file exist <path>` | Check if file exists on device | `<path>` on-device file path |
|
|
134
|
+
| `file delete <path>` | Delete file on device | `<path>` on-device file path |
|
|
135
|
+
| `clipboard read` | Read clipboard text | — |
|
|
136
|
+
| `clipboard write <text>` | Write text to clipboard | `<text>` positional arg |
|
|
137
|
+
| `clipboard clear` | Clear clipboard | — |
|
|
138
|
+
| `font info <fontpath>` | Query font info | `<fontpath>` font file path |
|
|
139
|
+
| `font install <fontpath>` | Install font file | `<fontpath>` font file path |
|
|
140
|
+
| `font uninstall <name>` | Uninstall font by name | `<name>` font name |
|
|
141
|
+
| `viewmode` | Get current dark/light mode | — |
|
|
142
|
+
| `viewmode dark` | Set dark mode | — |
|
|
143
|
+
| `viewmode light` | Set light mode | — |
|
|
144
|
+
| `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) |
|
|
145
|
+
| `location set` (gpx) | Mock location from GPX file | `--gpx-file <path>`, `--interval <seconds>` (mutually exclusive with lat/lon mode) |
|
|
146
|
+
| `location enable` | Turn on location mock (also done automatically by `set`) | — |
|
|
147
|
+
| `location disable` | Turn off and restore real location | — |
|
|
148
|
+
| `network-sim start` (preset) | Start preset scenario (1–8) | `--id <n>` |
|
|
149
|
+
| `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) |
|
|
150
|
+
| `network-sim stop` | Clear simulation, delete custom scenario, disable netcopilot (idempotent) | — |
|
|
151
|
+
| `network-sim list` | Show preset scenarios | — |
|
|
152
|
+
| `network-sim status` | Report enabled/disabled | — |
|
|
153
|
+
| `playback list` | Show active media sessions (bundle name + session ID) | — |
|
|
154
|
+
| `playback play` | Play media | `--id <sessionID>` or `--bundle <bundleName>` |
|
|
155
|
+
| `playback pause` | Pause media | `--id <sessionID>` or `--bundle <bundleName>` |
|
|
156
|
+
| `playback next` | Next track | `--id <sessionID>` or `--bundle <bundleName>` |
|
|
157
|
+
| `playback previous` | Previous track | `--id <sessionID>` or `--bundle <bundleName>` |
|
|
158
|
+
| `playback forward` | Fast forward (step size app-defined) | `--id <sessionID>` or `--bundle <bundleName>` |
|
|
159
|
+
| `playback rewind` | Rewind (step size app-defined) | `--id <sessionID>` or `--bundle <bundleName>` |
|
|
160
|
+
| `playback seek` | Jump to position | `--position <seconds>`, `--id <sessionID>` or `--bundle <bundleName>` |
|
|
161
|
+
|
|
162
|
+
- `location`: requires system version 7.0+ (testhelper).
|
|
163
|
+
- `network-sim`: requires API 20+ (netcopilot).
|
|
164
|
+
- `playback`: requires system version 6.1+ (ohos-avsession-manager).
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
### `devecocli run` `[Outside sandbox]`
|
|
169
|
+
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` (crash log path via `crash_log:`, blank screenshot via `screenshot:`) and exit non-zero. Smoke is skipped when there is no ability to launch, and for `--hotreload` / `--hotreload-apply`.
|
|
170
|
+
- `--module <m1> [m2...]`: Target module(s) (auto-selected if only one runnable).
|
|
171
|
+
- `--device <name|serial>`: Target device (Req if multiple connected).
|
|
172
|
+
- `--product <product>` / `--build-mode <mode>`: Defaults: `default` / `debug`.
|
|
173
|
+
- `--ability <ability>`: Default from `module.json5`.
|
|
174
|
+
- `--uninstall`: Uninstall existing app first (Fixes signing key issues).
|
|
175
|
+
- `--skip-build`: Deploy existing artifacts.
|
|
176
|
+
- `--debug-line`: Forward `-p debugLine=true` to hvigor for the full build, `--apply`, and hot-reload compiles (default: disabled).
|
|
177
|
+
- `--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).
|
|
178
|
+
- `<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.
|
|
179
|
+
- **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.
|
|
180
|
+
- **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.
|
|
181
|
+
- **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.
|
|
182
|
+
*Ex*: `devecocli run` → edit code → write `.hvigor/changes.txt` → `devecocli run --apply changes.txt`
|
|
183
|
+
- `--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.
|
|
184
|
+
- **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`.
|
|
185
|
+
- `--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.
|
|
186
|
+
- **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`.
|
|
187
|
+
- **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.
|
|
188
|
+
- **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.
|
|
189
|
+
- **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).
|
|
190
|
+
- **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`.
|
|
191
|
+
*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`.
|
|
192
|
+
|
|
193
|
+
### `devecocli signature generate` `[Outside sandbox]`
|
|
194
|
+
Auto-generate HarmonyOS signing materials (local p12/csr + cloud cert + profile) and write signing config to `build-profile.json5`. Supports `debug` and `release` signing types.
|
|
195
|
+
- **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 (debug only; release signing skips device registration).
|
|
196
|
+
- `--product <name>`: Product name for local p12/csr file naming (default: `default`).
|
|
197
|
+
- `--team-id <id>`: Specify the team-id (default: current user's id).
|
|
198
|
+
- `--type <type>`: Signing type: `debug` or `release` (default: `debug`). Release uses real provision endpoint and release certificate type; debug uses test provision and debug certificate.
|
|
199
|
+
- `--force`: Force regenerate even if existing materials are valid.
|
|
200
|
+
- Generates under `~/.ohos/config/`: `.p12` keystore, `.csr`, downloaded `.cer` certificate, `.p7b` profile. Debug and release materials use separate file paths (release paths include `_release` segment).
|
|
201
|
+
- Writes `signingConfigs` + `products` entries to `build-profile.json5` with encrypted key/store passwords (AES-128-GCM). Release configs use `<product>_release` as the config name.
|
|
202
|
+
- Cloud cert name: `auto_debug_<teamId>.cer` (debug) or `auto_release_<teamId>.cer` (release). Key alias: `debugKey` (debug) or `releaseKey` (release).
|
|
203
|
+
- 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.
|
|
204
|
+
*Ex*: `devecocli signature generate --product default` / `devecocli signature generate --type release`
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
### `devecocli log`
|
|
208
|
+
Fetch hilog or crash logs. Req `--device <name|serial>` on multi-device hosts.
|
|
209
|
+
- `--crash`: Dump crash logs.
|
|
210
|
+
- `--level D|I|W|E|F`: Filter by level.
|
|
211
|
+
- `--bundle-name` / `--keyword`: Filter output.
|
|
212
|
+
- `--from <start>` / `--to <end>`: Relative offsets (`30s`, `5m`).
|
|
213
|
+
- `--tail <num>` / `--follow`: Keep last N lines / stream real-time (no `--to`).
|
|
214
|
+
- `--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.
|
|
215
|
+
- `--stack` + `--path <file>`: Analyze a local sample stack file (enhanced log); mutually exclusive with `--crash`.
|
|
216
|
+
- `--format default|json|report|hilog`: Output format for local analysis (`hilog` extracts the HiLog section, `--crash` only).
|
|
217
|
+
- `--limit <num>`: Max hotspots shown by `--stack` (default 20).
|
|
218
|
+
- `--path` cannot be combined with device log options (`--device`, `--level`, `--bundle-name`, `--keyword`, `--tail`, `--from`, `--to`, `--follow`).
|
|
219
|
+
*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`
|
|
220
|
+
|
|
221
|
+
### `devecocli verify`
|
|
222
|
+
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.
|
|
223
|
+
|
|
224
|
+
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.
|
|
225
|
+
|
|
226
|
+
- `--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:
|
|
227
|
+
```
|
|
228
|
+
1. 启动应用,预期:进入应用主界面,底部显示「书架」「发现」「订阅源」三个Tab
|
|
229
|
+
2. 点击「发现」Tab,预期:进入发现页面
|
|
230
|
+
3. 点击「订阅源」Tab,预期:进入订阅源页面
|
|
231
|
+
4. 点击「书架」Tab,预期:返回书架页面
|
|
232
|
+
```
|
|
233
|
+
- `--bundle-name <name>` — Bundle name of the app to be tested; auto-detected from `AppScope/app.json5` when omitted.
|
|
234
|
+
- `--no-fresh-start` — Skip relaunching the app before verification; omit to relaunch by default.
|
|
235
|
+
- `--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"`).
|
|
236
|
+
|
|
237
|
+
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).
|
|
238
|
+
|
|
239
|
+
Each UI verification run is limited to 10 minutes.
|
|
240
|
+
|
|
241
|
+
Usage guidance:
|
|
242
|
+
- Write a test plan based on the user's description and call `devecocli verify --test-plan '...'`
|
|
243
|
+
- If log analysis is needed, call `devecocli verify log --id <id>` to retrieve the execution log
|
|
244
|
+
- If screenshots are needed, call `devecocli verify screenshot --id <id> --save-path <path>` to save step-by-step screenshots
|
|
245
|
+
|
|
246
|
+
Examples:
|
|
247
|
+
- `devecocli verify --test-plan '1. 启动应用,预期:进入应用主界面'`
|
|
248
|
+
- `devecocli verify --test-plan '1. 启动应用,deeplink跳转到"aigomall://test/order-confirm",预期:显示订单提交页面'`
|
|
249
|
+
- `devecocli verify --test-plan '1. 启动应用,预期:进入应用主界面' --bundle-name com.example.app`
|
|
250
|
+
- `devecocli verify --test-plan '1. 启动应用,预期:进入应用主界面' --no-fresh-start`
|
|
251
|
+
- `devecocli verify --test-plan '1. 启动应用,预期:进入应用主界面' --device 127.0.0.1:5555`
|
|
252
|
+
|
|
253
|
+
### `devecocli verify appanalyzer` `[Outside sandbox]`
|
|
254
|
+
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.
|
|
255
|
+
- **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.
|
|
256
|
+
|
|
257
|
+
| Subcommand | Description |
|
|
258
|
+
|---|---|
|
|
259
|
+
| `init` | Initialize the tool environment (installs Python dependencies). |
|
|
260
|
+
| `autoAnalyze` | Automated page traversal + detection. |
|
|
261
|
+
| `uxAnalyze` | Manual single-page UX detection; put the device on the target page and keep the screen on first. |
|
|
262
|
+
| `powerAnalyze` | Manual power-consumption detection: records ~15s of the app standing by in the foreground, then reports. Real devices only. |
|
|
263
|
+
|
|
264
|
+
- **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).
|
|
265
|
+
- `autoAnalyze` also takes `-t/--duration <minutes>` (5–240, default `10`).
|
|
266
|
+
- Reports are written as both JSON and ZIP to the output path.
|
|
267
|
+
|
|
268
|
+
**Scenes** — `-s` takes a category (`Dxx`, runs every scene under it) or individual scenes (`Sxx`, comma-separated):
|
|
269
|
+
|
|
270
|
+
| Category | Meaning | Scenes |
|
|
271
|
+
|---|---|---|
|
|
272
|
+
| `D03` | UX — multi-device layout adaptation | `S14` truncation, `S15` large image/large font, `S16` white space, `S17` avoid-area occlusion, `S18` foundation |
|
|
273
|
+
| `D04` | Power consumption | `S11` foreground standby |
|
|
274
|
+
|
|
275
|
+
*Ex*: `devecocli verify appanalyzer init`
|
|
276
|
+
*Ex*: `devecocli verify appanalyzer autoAnalyze -b com.example.app -p ./MyApp -s D03 -t 5 -o ./output`
|
|
277
|
+
*Ex*: `devecocli verify appanalyzer uxAnalyze -b com.example.app -p ./MyApp -s S14,S15 -d 127.0.0.1:5555`
|
|
278
|
+
*Ex*: `devecocli verify appanalyzer powerAnalyze -b com.example.app -p ./MyApp`
|
|
279
|
+
|
|
280
|
+
### `devecocli verify log`
|
|
281
|
+
Retrieve the execution log of a verification task by ID.
|
|
282
|
+
|
|
283
|
+
- `--id <id>` (**required**) — Task ID from the `id` field in `verify` output.
|
|
284
|
+
- `--search-keywords <keywords>` — Filter to lines containing the keyword; **wrap value in single quotes**.
|
|
285
|
+
- `--max-log-size <n>` — Max characters to show (default `5000`; `-1` for unlimited).
|
|
286
|
+
|
|
287
|
+
Examples:
|
|
288
|
+
- `devecocli verify log --id <id>`
|
|
289
|
+
- `devecocli verify log --id <id> --search-keywords 'error' --max-log-size -1`
|
|
290
|
+
|
|
291
|
+
### `devecocli verify screenshot`
|
|
292
|
+
Save step-by-step screenshots from a verification task to a specified directory; returns a list of saved file paths.
|
|
293
|
+
|
|
294
|
+
- `--id <id>` (**required**) — Task ID from the `id` field in `verify` output.
|
|
295
|
+
- `--save-path <path>` (**required**) — Absolute path to the target directory (created automatically if it does not exist).
|
|
296
|
+
|
|
297
|
+
Examples:
|
|
298
|
+
- `devecocli verify screenshot --id <id> --save-path 'C:\Users\user\Desktop\screenshots'`
|
|
299
|
+
|
|
300
|
+
### `devecocli ui`
|
|
301
|
+
Inspect UI on a connected device. All subcommands accept `--device <name|serial>` (Req on multi-device hosts).
|
|
302
|
+
|
|
303
|
+
| Subcommand | Description | Key Options |
|
|
304
|
+
|---|---|---|
|
|
305
|
+
| `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` |
|
|
306
|
+
| `window list` | List active windows | `--format default\|json`, `--all` (include system windows) |
|
|
307
|
+
| `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) |
|
|
308
|
+
| `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` |
|
|
309
|
+
| `click [x] [y]` | Tap at the specified coordinates or node | `--id <id>` (auto-resolves to center), `--selector <expr>`, `--window <windowId>` (used with `--id` or `--selector`) |
|
|
310
|
+
| `doubleclick [x] [y]` | Double-tap at the specified coordinates or node | `--id <id>`, `--selector <expr>`, `--window <windowId>` |
|
|
311
|
+
| `longclick [x] [y]` | Long-press at the specified coordinates or node | `--id <id>`, `--selector <expr>`, `--duration <ms>` (500–60000, default 1000), `--window <windowId>` |
|
|
312
|
+
| `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) |
|
|
313
|
+
| `fling <x1> <y1> <x2> <y2>` | Fling from one point to another | `--speed <n>` (200–40000, px/s) |
|
|
314
|
+
| `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) |
|
|
315
|
+
| `dircfling <direction>` | Quick directional fling (system default speed, ideal for scrolling) | `direction`: `up`, `down`, `left`, `right` |
|
|
316
|
+
| `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 `--id` or `--selector`) |
|
|
317
|
+
| `cleartext` | Clear text via Ctrl+A + Del (optionally click target element first) | `--selector <expr>` (click before clearing; default: focused field), `--window <windowId>` |
|
|
318
|
+
| `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) |
|
|
319
|
+
| `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) |
|
|
320
|
+
| `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) |
|
|
321
|
+
| `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>` |
|
|
322
|
+
| `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`) |
|
|
323
|
+
| `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 |
|
|
324
|
+
| `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` |
|
|
325
|
+
| `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 |
|
|
326
|
+
|
|
327
|
+
- **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).
|
|
328
|
+
- **`--window`**: Default is focused window. May be used with `--id`, `--selector`, or coordinate mode.
|
|
329
|
+
- **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.
|
|
330
|
+
- **`swipe`/`drag` element mode**: `--start <expr> --end <expr>` resolves each selector to bounds center, then performs the swipe/drag. Both must be provided together.
|
|
331
|
+
- **`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`).
|
|
332
|
+
- **`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).
|
|
333
|
+
- **`scrollsearch`**: The target `<selector>` does not support an index (`[n]`); passing one triggers an error.
|
|
334
|
+
- **Text encoding**: Special characters in `text` are Base64-encoded internally to safely pass through device shell.
|
|
335
|
+
- `--format json` pairs well with `jq`.
|
|
336
|
+
- `--mode full`: full layout tree, no filtering.
|
|
337
|
+
- `--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.
|
|
338
|
+
|
|
339
|
+
### `devecocli testing` `[Outside sandbox]`
|
|
340
|
+
|
|
341
|
+
Run DevEco Testing detection services on a connected device.
|
|
342
|
+
|
|
343
|
+
| Sub-command | Parameters |
|
|
344
|
+
|---|---|
|
|
345
|
+
| `list` | — (`ServiceKey`, `Status`) |
|
|
346
|
+
| `install` | `--service <serviceKey>` |
|
|
347
|
+
| `update` | `--service <serviceKey>` |
|
|
348
|
+
| `run <serviceKey>` | `--package <bundleName>`, `--sn <serial[,serial]>`, `--duration <minutes>`, `--yes` |
|
|
349
|
+
| `stop` | `--task-id <taskId>` |
|
|
350
|
+
| `userinfo`, `exit` | — |
|
|
351
|
+
|
|
352
|
+
Parameter reference: `devecocli testing <sub-command> --help`.
|
|
353
|
+
|
|
354
|
+
```powershell
|
|
355
|
+
devecocli testing list
|
|
356
|
+
devecocli testing install --service MemLeakTest
|
|
357
|
+
devecocli testing update --service MemLeakTest
|
|
358
|
+
devecocli testing run MemLeakTest --package com.example.myapp --sn <serial> --duration 10 --yes
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
**Device**: `--sn` must be the device the user confirmed. With several devices connected (`devecocli device list`), ask which one to test and wait for the answer; never default to the first serial.
|
|
362
|
+
|
|
363
|
+
**Progress**: run `testing run` with the globally installed CLI (`& "$env:APPDATA\npm\devecocli.cmd"` on Windows, `"$(npm prefix -g)/bin/devecocli"` elsewhere) so output streams.
|
|
364
|
+
|
|
365
|
+
**Result**: the run ends with `[REPORT] 报告已生成: <dir>`; read `<dir>/export/2d_report_data.json` (`isTaskPass`, `expandData[].resultSummary`, `expandData[].resultDetails[].status`) or `<dir>/export/Task-*.html` — never print the JSON. Services that write no `2d_report_data.json` keep the verdict in `<dir>/report/<taskId>_report.json` (`taskResult.taskPass`). Exit code stays `0` even when the task fails; on failure read `[ERROR]` / `[SUGGEST]`.
|
|
366
|
+
|
|
367
|
+
## 2. Setup
|
|
368
|
+
|
|
369
|
+
### Agent Plugins
|
|
370
|
+
|
|
371
|
+
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.
|
|
372
|
+
|
|
373
|
+
### `devecocli init`
|
|
374
|
+
MUTUALLY EXCLUSIVE modes for setup:
|
|
375
|
+
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.
|
|
376
|
+
2. `--mcp`: Configure `deveco-mcp` server (ArkTS/C++ syntax checking).
|
|
377
|
+
*Options*:
|
|
378
|
+
- `--agent <agents>`: Comma-separated (e.g. `opencode,pi,cursor`). Defaults to detected agents.
|
|
379
|
+
- `--project <path>`: Project-level config (Abs path for MCP).
|
|
380
|
+
- `--path <path>`: Direct skill install path; cannot combine with `--agent`, `--project` or `--mcp`.
|
|
381
|
+
- `--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`.
|
|
382
|
+
*MCP Rules*: Configured MCP agents support global (no `--project`) and project-level setup; `qoder` is unsupported.
|
|
383
|
+
*Skill agents*: See README.md, “Skill 支持的智能体”. All supported agents allow global and project installation. If an agent is not detected, specify `--agent`.
|
|
384
|
+
|
|
385
|
+
**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).
|
|
386
|
+
|
|
387
|
+
### `devecocli auth login`
|
|
388
|
+
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).
|
|
389
|
+
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.
|
|
390
|
+
*Ex*: `devecocli auth login --no-prompt`
|
|
391
|
+
|
|
392
|
+
### `devecocli auth logout`
|
|
393
|
+
Sign out and clear locally stored credentials.
|
|
394
|
+
|
|
395
|
+
### `devecocli auth status`
|
|
396
|
+
Show the current logged-in user.
|
|
397
|
+
|
|
398
|
+
### `devecocli auth team list`
|
|
399
|
+
List team accounts the current user has joined.
|
|
400
|
+
|
|
401
|
+
### `devecocli skills`
|
|
402
|
+
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.
|
|
403
|
+
- `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.
|
|
404
|
+
- `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`.)
|
|
405
|
+
- `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.
|
|
406
|
+
- Ordinary project paths such as `skills/` and `data/` require an explicit `--agent` for installation or removal; automatic selection ignores them.
|
|
407
|
+
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.
|
|
408
|
+
|
|
409
|
+
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`.
|
|
410
|
+
|
|
411
|
+
**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.
|
|
412
|
+
|
|
413
|
+
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.
|
|
414
|
+
|
|
415
|
+
*Ex*: `devecocli skills add --skill <name> --agent opencode --project ./MyApp`
|
|
416
|
+
|
|
417
|
+
### `devecocli plugin`
|
|
418
|
+
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`).
|
|
419
|
+
- `list [-l|--long]`: List whitelisted plugins and locally downloaded versions in a `Name / Version / Status` table (one row per cached version, ascending; `not installed` when none); `--long` appends `NpmPackage` and `Desc` columns.
|
|
420
|
+
- `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`.
|
|
421
|
+
- `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`.
|
|
422
|
+
- `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.
|
|
423
|
+
- Hook execution is capped at 120s (override with `DEVECO_CLI_PLUGIN_HOOK_TIMEOUT_MS`).
|
|
424
|
+
|
|
425
|
+
*Ex*: `devecocli plugin install example-plugin --agent opencode --project ./MyApp`
|
|
426
|
+
|
|
427
|
+
### `devecocli check compat` `[Outside sandbox]`
|
|
428
|
+
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.
|
|
429
|
+
- `versions`: List available target SDK versions. Opts: `--format <default|json>` (default: `default`).
|
|
430
|
+
- Default (no args): project-level scan.
|
|
431
|
+
- `--modules <m1> [m2...]`: Module-level scan.
|
|
432
|
+
- `<file1> [file2...]`: File-level scan (`.ets`/`.c`/`.cpp` only).
|
|
433
|
+
- `--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>"`).
|
|
434
|
+
- `--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`.
|
|
435
|
+
- `--output-path <path>`: Directory (writes `apiChange-*.csv`/`apiChange-*.json`) or explicit file (extension must match `--format`).
|
|
436
|
+
- `--limit <n>` (default `100`): Max records shown on console when no `--output-path`.
|
|
437
|
+
|
|
438
|
+
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.
|
|
439
|
+
|
|
440
|
+
*Ex*: `devecocli check compat --source-version "<source_version>" --target-version "<target_version>" --output-path ./report`
|
|
441
|
+
|
|
442
|
+
### `devecocli design2arkts` (alias: `d2a`)
|
|
443
|
+
|
|
444
|
+
Use `devecocli d2a --help` for Pixso/Figma design-to-ArkTS workflows and standalone capabilities accepting local images or code without a prior D2A run.
|
|
445
|
+
|
|
446
|
+
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.
|
|
447
|
+
|
|
448
|
+
## 3. Maintenance
|
|
449
|
+
|
|
450
|
+
- **`devecocli update`** `[Outside sandbox]`: Update CLI to latest version.
|
|
451
|
+
- **`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`).
|
|
452
|
+
- **`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).
|
|
453
|
+
- Agents/editors with a built-in LSP client drive it directly — e.g. **opencode** (`lsp` config in `opencode.json`), **Zed**, **Neovim**, **VS Code**, **Emacs**:
|
|
454
|
+
`"lsp": { "ArkTS": { "command": ["devecocli", "serve", "lsp", "--arkts"], "extensions": [".ets"] } }`
|
|
455
|
+
- 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"]`.
|
|
456
|
+
- **`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.
|
|
457
|
+
- **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).
|
|
458
|
+
|
|
459
|
+
## Recipes
|
|
460
|
+
|
|
461
|
+
- **Fresh checkout to emulator**:
|
|
462
|
+
`devecocli build` -> `devecocli emulator list` -> `devecocli emulator start "Name"` -> `devecocli run`
|
|
463
|
+
- **Diagnose crash**:
|
|
464
|
+
`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)
|
|
465
|
+
- **Release build**:
|
|
466
|
+
`devecocli build --product oversea --build-mode release`
|
|
467
|
+
- **First-time signing setup** (login authorized; user completes browser authentication):
|
|
468
|
+
`devecocli auth login --no-prompt` -> `devecocli signature generate --product default` -> `devecocli build` -> `devecocli run`
|
|
469
|
+
- **One-sentence detection run** (e.g. "测试商城应用内存泄漏"):
|
|
470
|
+
read `AppScope/app.json5` for the bundle name and `devecocli device list` for the serial ->
|
|
471
|
+
`devecocli testing list` -> `devecocli testing install --service MemLeakTest` if `Not installed` ->
|
|
472
|
+
`devecocli testing run MemLeakTest --package <bundleName> --sn <serial> --duration 240 --yes` -> summarize `[REPORT]`
|
|
473
|
+
|
|
474
|
+
## Troubleshooting
|
|
475
|
+
|
|
476
|
+
- **"Product / Build mode `<x>` not found"**: Check `build-profile.json5`.
|
|
477
|
+
- **"Multiple entry modules" / "No entry module"**: Pass `--modules` (build) or `--module` (run).
|
|
478
|
+
- **"No active devices" / "Multiple devices connected"**: Connect/start emulator. Pass `-t <serial>` (device view) or `--device <name|serial>` (run/log).
|
|
479
|
+
- **`error:install sign info inconsistent`**: Signing key changed. Run `devecocli run --uninstall` or `devecocli signature generate --force`.
|
|
480
|
+
- **`Not logged in. Run devecocli auth login first`**: Run `devecocli auth login --no-prompt` with login authorization (see Setup).
|
|
481
|
+
- **`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`.
|
|
482
|
+
- **`Invalid AccessToken. Sign in and try again`**: Token expired. Run `devecocli auth login --no-prompt` with login authorization (see Setup).
|
|
483
|
+
- **Invalid Skill agent**: Use an ID from the README supported-agent list.
|
|
484
|
+
- **`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.
|
|
485
|
+
- **`image download` failure / timeout**: Do NOT auto-retry. Give the command to the user to run manually in their terminal.
|
|
486
|
+
- **`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.
|
|
487
|
+
- **`image list` duplicate OS rows**: `phone`/`foldable`/`widefold`/`triplefold` share the same image. Download/remove ONCE per OS version.
|
|
488
|
+
- **`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.
|
|
489
|
+
- **`未找到 DevEco Testing 安装`**: Install the DevEco Testing client or point `DEVECO_TESTING_HOME` at its install root; `devecocli testing help` confirms the path works.
|
|
490
|
+
- **`当前 DevEco Testing 版本不支持 testing`**: The installed client is too old. Run `devecocli testing update`, then retry.
|
|
491
|
+
- **`[ERROR] 前置确认未通过`**: `run` hit the confirmation prompt in a non-interactive shell. Add `--yes`.
|
|
492
|
+
- **`run` killed mid-test**: The bash timeout was shorter than the test. Re-run with a longer timeout; a killed run produces no report.
|
|
493
|
+
- **"Skills marketplace is not available in your region"**: Expected when running `skills list/find/add` outside Chinese mainland (incl. HK/MO). Installed skills still work; `skills remove` and `init` don't touch the network.
|
|
494
|
+
- **"CLI online services are not available in your region"**: Commands needing cloud services (login/signature/agreement) abort when GRS is unreachable or the region has no config; local-only commands (`create`/`build`/`device`) are unaffected. 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).
|