fix: standardize build output path to outputs/default/bundles/signed

This commit is contained in:
cheliangzhao
2026-02-11 11:46:38 +08:00
parent 01da810dfa
commit d1d89b7225
3 changed files with 25 additions and 37 deletions

View File

@@ -18,14 +18,14 @@ All HAP/HSP modules must have the **same versionCode**. Mismatched versions caus
# Using Python (cross-platform)
python3 -c "
import zipfile, json, glob
for f in glob.glob('outputs/default/signed/*.hsp'):
for f in glob.glob('outputs/default/bundles/signed/*.hsp'):
z = zipfile.ZipFile(f)
data = json.loads(z.read('module.json'))
print(f\"{f.split('/')[-1]}: versionCode = {data['app']['versionCode']}\")
"
# Using unzip + grep (Linux/macOS)
for f in outputs/default/signed/*.hsp; do
for f in outputs/default/bundles/signed/*.hsp; do
echo -n "$(basename $f): "
unzip -p "$f" module.json | grep -o '"versionCode":[0-9]*'
done
@@ -40,7 +40,7 @@ A module should be removed from the output before installation if:
3. Module versionCode differs from `AppScope/app.json5`
```bash
rm outputs/default/signed/problematic-module-default-signed.hsp
rm outputs/default/bundles/signed/problematic-module-default-signed.hsp
```
## Complete Installation Workflow
@@ -66,7 +66,7 @@ INSTALL_DIR="/data/local/tmp/install_$(date +%s)"
hdc -t <UDID> shell "mkdir -p $INSTALL_DIR"
# Push signed HAP/HSP files
hdc -t <UDID> file send outputs/default/signed $INSTALL_DIR
hdc -t <UDID> file send outputs/default/bundles/signed $INSTALL_DIR
```
### Step 3: Install Application
@@ -100,7 +100,7 @@ Save as `install.sh` (Linux/macOS) or run with Git Bash on Windows:
# === Configuration ===
DEVICE_ID="${1:-$(hdc list targets | head -1)}"
SIGNED_PATH="${2:-outputs/default/signed}"
SIGNED_PATH="${2:-outputs/default/bundles/signed}"
BUNDLE_NAME="${3:-}"
REMOTE_PATH="/data/local/tmp/install_$(date +%s)"
@@ -146,24 +146,22 @@ Usage:
./install.sh 1234567890ABCDEF
# Specify device and path
./install.sh 1234567890ABCDEF outputs/default/signed
./install.sh 1234567890ABCDEF outputs/default/bundles/signed
# Specify device, path, and bundle name (auto-launch)
./install.sh 1234567890ABCDEF outputs/default/signed com.example.app
./install.sh 1234567890ABCDEF outputs/default/bundles/signed com.example.app
```
## Build Output Structure
```
outputs/
└── {product}/ # e.g., default/
── {project}-{product}-signed.app # Complete APP bundle
── signed/
├── entry-{product}-signed.hap # Main entry HAP
├── feature-{product}-signed.hap # Feature HAP (if any)
└── *.hsp # Shared library modules
└── unsigned/
└── ... # Unsigned versions
└── default/
── bundles/
── signed/
├── entry-default-signed.hap # Main entry HAP
├── feature-default-signed.hap # Feature HAP (if any)
└── *.hsp # Shared library modules
```
## Troubleshooting Details