chore(android): 构建脚本拆分开发与生产两套环境

- 新增 scripts/android-sync.ps1:dev 注入局域网接口地址,prod 清掉 VITE_API_BASE_URL 走 .env.production
- 新增 android:sync:dev / android:sync:prod,android:sync 保留为 prod 别名
- android-open.ps1 改为复用 android:sync:dev,不再自己拼环境变量
- NATIVE_UPGRADE.md 补充「打壳前必须 sync:prod」与产物核对项
This commit is contained in:
Timi
2026-11-17 14:51:00 +08:00
parent f3689a2ccc
commit bac3a15cbe
4 changed files with 37 additions and 10 deletions
+4 -2
View File
@@ -14,9 +14,11 @@
"lint": "eslint . --ext .ts,.vue",
"type-check": "vue-tsc -p tsconfig.app.json --noEmit",
"type-check:publish": "vue-tsc -p tsconfig.publish.json --noEmit",
"android:sync": "pnpm run build && cap sync android",
"android:sync:dev": "powershell -NoProfile -ExecutionPolicy Bypass -File scripts/android-sync.ps1 -Mode dev",
"android:sync:prod": "powershell -NoProfile -ExecutionPolicy Bypass -File scripts/android-sync.ps1 -Mode prod",
"android:sync": "pnpm run android:sync:prod",
"android:open": "powershell -NoProfile -ExecutionPolicy Bypass -File scripts/android-open.ps1",
"android:apk": "pnpm run android:sync && cd android && gradlew.bat assembleDebug"
"android:apk": "pnpm run android:sync:prod && cd android && gradlew.bat assembleDebug"
},
"dependencies": {
"@capacitor/android": "^8",