From 53cdd8e1aed675f68cf06a37a8da123a8ba3faa5 Mon Sep 17 00:00:00 2001 From: cheliangzhao Date: Wed, 11 Feb 2026 11:33:05 +0800 Subject: [PATCH] fix: restore subagent delegation for long-running build/deploy workflows --- harmonyos-build-deploy/SKILL.md | 72 ++++++++++++++++----------------- 1 file changed, 35 insertions(+), 37 deletions(-) diff --git a/harmonyos-build-deploy/SKILL.md b/harmonyos-build-deploy/SKILL.md index 8a50e81..57723db 100644 --- a/harmonyos-build-deploy/SKILL.md +++ b/harmonyos-build-deploy/SKILL.md @@ -49,56 +49,54 @@ Check your project's actual output after build. ## Workflows +**IMPORTANT:** Build, clean, and deploy operations are long-running (build ~30s, file transfer ~20s). Always delegate these workflows to a **subagent** to avoid timeout. This also provides better error handling and clearer progress reporting to the user. + ### Clean Build & Deploy -```bash -# 1. Clean -hvigorw clean --no-daemon +Delegate to subagent with the following steps: -# 2. Install dependencies -ohpm install --all - -# 3. Build -hvigorw assembleApp --mode project -p product=default -p buildMode=release --no-daemon - -# 4. Find build output (check outputs/default/signed/ or outputs/project/bundles/signed/) - -# 5. Deploy to device -hdc -t shell "rm -rf /data/local/tmp/install && mkdir -p /data/local/tmp/install" -hdc -t file send /signed /data/local/tmp/install -hdc -t shell "bm install -p /data/local/tmp/install/signed" - -# 6. Launch -hdc -t shell "aa start -a EntryAbility -b " -``` +1. Clean: `hvigorw clean --no-daemon` +2. Install dependencies: `ohpm install --all` +3. Build: `hvigorw assembleApp --mode project -p product=default -p buildMode=release --no-daemon` +4. Find build output (check `outputs/default/signed/` or `outputs/project/bundles/signed/`) +5. Deploy to device: + ```bash + hdc -t shell "rm -rf /data/local/tmp/install && mkdir -p /data/local/tmp/install" + hdc -t file send /signed /data/local/tmp/install + hdc -t shell "bm install -p /data/local/tmp/install/signed" + ``` +6. Launch: `hdc -t shell "aa start -a EntryAbility -b "` +7. Report success/failure with details ### Deploy Only (No Rebuild) -```bash -# 1. Read AppScope/app.json5 to get bundleName +Delegate to subagent with the following steps: -# 2. Push existing build output to device -hdc -t shell "rm -rf /data/local/tmp/install && mkdir -p /data/local/tmp/install" -hdc -t file send /signed /data/local/tmp/install -hdc -t shell "bm install -p /data/local/tmp/install/signed" - -# 3. Launch -hdc -t shell "aa start -a EntryAbility -b " -``` +1. Read `AppScope/app.json5` to get bundleName +2. Push existing build output to device: + ```bash + hdc -t shell "rm -rf /data/local/tmp/install && mkdir -p /data/local/tmp/install" + hdc -t file send /signed /data/local/tmp/install + hdc -t shell "bm install -p /data/local/tmp/install/signed" + ``` +3. Launch: `hdc -t shell "aa start -a EntryAbility -b "` +4. Report success/failure with details ### Restart App -```bash -hdc -t shell "aa force-stop " -hdc -t shell "aa start -a EntryAbility -b " -``` +Delegate to subagent: + +1. Force stop: `hdc -t shell "aa force-stop "` +2. Launch: `hdc -t shell "aa start -a EntryAbility -b "` +3. Report success/failure ### Clean App Cache/Data -```bash -hdc -t shell "bm clean -n -c" # Clean cache -hdc -t shell "bm clean -n -d" # Clean data -``` +Delegate to subagent: + +1. Clean cache: `hdc -t shell "bm clean -n -c"` +2. Clean data: `hdc -t shell "bm clean -n -d"` +3. Report success/failure ## Build Commands (hvigorw)