fix: restore subagent delegation for long-running build/deploy workflows
This commit is contained in:
@@ -49,56 +49,54 @@ Check your project's actual output after build.
|
|||||||
|
|
||||||
## Workflows
|
## 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
|
### Clean Build & Deploy
|
||||||
|
|
||||||
```bash
|
Delegate to subagent with the following steps:
|
||||||
# 1. Clean
|
|
||||||
hvigorw clean --no-daemon
|
|
||||||
|
|
||||||
# 2. Install dependencies
|
1. Clean: `hvigorw clean --no-daemon`
|
||||||
ohpm install --all
|
2. Install dependencies: `ohpm install --all`
|
||||||
|
3. Build: `hvigorw assembleApp --mode project -p product=default -p buildMode=release --no-daemon`
|
||||||
# 3. Build
|
4. Find build output (check `outputs/default/signed/` or `outputs/project/bundles/signed/`)
|
||||||
hvigorw assembleApp --mode project -p product=default -p buildMode=release --no-daemon
|
5. Deploy to device:
|
||||||
|
```bash
|
||||||
# 4. Find build output (check outputs/default/signed/ or outputs/project/bundles/signed/)
|
hdc -t <UDID> shell "rm -rf /data/local/tmp/install && mkdir -p /data/local/tmp/install"
|
||||||
|
hdc -t <UDID> file send <output_path>/signed /data/local/tmp/install
|
||||||
# 5. Deploy to device
|
hdc -t <UDID> shell "bm install -p /data/local/tmp/install/signed"
|
||||||
hdc -t <UDID> shell "rm -rf /data/local/tmp/install && mkdir -p /data/local/tmp/install"
|
```
|
||||||
hdc -t <UDID> file send <output_path>/signed /data/local/tmp/install
|
6. Launch: `hdc -t <UDID> shell "aa start -a EntryAbility -b <bundleName>"`
|
||||||
hdc -t <UDID> shell "bm install -p /data/local/tmp/install/signed"
|
7. Report success/failure with details
|
||||||
|
|
||||||
# 6. Launch
|
|
||||||
hdc -t <UDID> shell "aa start -a EntryAbility -b <bundleName>"
|
|
||||||
```
|
|
||||||
|
|
||||||
### Deploy Only (No Rebuild)
|
### Deploy Only (No Rebuild)
|
||||||
|
|
||||||
```bash
|
Delegate to subagent with the following steps:
|
||||||
# 1. Read AppScope/app.json5 to get bundleName
|
|
||||||
|
|
||||||
# 2. Push existing build output to device
|
1. Read `AppScope/app.json5` to get bundleName
|
||||||
hdc -t <UDID> shell "rm -rf /data/local/tmp/install && mkdir -p /data/local/tmp/install"
|
2. Push existing build output to device:
|
||||||
hdc -t <UDID> file send <output_path>/signed /data/local/tmp/install
|
```bash
|
||||||
hdc -t <UDID> shell "bm install -p /data/local/tmp/install/signed"
|
hdc -t <UDID> shell "rm -rf /data/local/tmp/install && mkdir -p /data/local/tmp/install"
|
||||||
|
hdc -t <UDID> file send <output_path>/signed /data/local/tmp/install
|
||||||
# 3. Launch
|
hdc -t <UDID> shell "bm install -p /data/local/tmp/install/signed"
|
||||||
hdc -t <UDID> shell "aa start -a EntryAbility -b <bundleName>"
|
```
|
||||||
```
|
3. Launch: `hdc -t <UDID> shell "aa start -a EntryAbility -b <bundleName>"`
|
||||||
|
4. Report success/failure with details
|
||||||
|
|
||||||
### Restart App
|
### Restart App
|
||||||
|
|
||||||
```bash
|
Delegate to subagent:
|
||||||
hdc -t <UDID> shell "aa force-stop <bundleName>"
|
|
||||||
hdc -t <UDID> shell "aa start -a EntryAbility -b <bundleName>"
|
1. Force stop: `hdc -t <UDID> shell "aa force-stop <bundleName>"`
|
||||||
```
|
2. Launch: `hdc -t <UDID> shell "aa start -a EntryAbility -b <bundleName>"`
|
||||||
|
3. Report success/failure
|
||||||
|
|
||||||
### Clean App Cache/Data
|
### Clean App Cache/Data
|
||||||
|
|
||||||
```bash
|
Delegate to subagent:
|
||||||
hdc -t <UDID> shell "bm clean -n <bundleName> -c" # Clean cache
|
|
||||||
hdc -t <UDID> shell "bm clean -n <bundleName> -d" # Clean data
|
1. Clean cache: `hdc -t <UDID> shell "bm clean -n <bundleName> -c"`
|
||||||
```
|
2. Clean data: `hdc -t <UDID> shell "bm clean -n <bundleName> -d"`
|
||||||
|
3. Report success/failure
|
||||||
|
|
||||||
## Build Commands (hvigorw)
|
## Build Commands (hvigorw)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user