62 lines
2.5 KiB
PowerShell
62 lines
2.5 KiB
PowerShell
# ========================================
|
||
# Android Studio 打包 - 快速开始
|
||
# ========================================
|
||
|
||
Write-Host "========================================"
|
||
Write-Host " Android Studio 打包助手"
|
||
Write-Host "========================================"
|
||
Write-Host ""
|
||
|
||
# 项目信息
|
||
$AppID = "__UNI__08E0C13"
|
||
$SDKPath = "D:\4_Part\HBuilder-Android\HBuilder-Integrate-AS"
|
||
|
||
# 检查 SDK 是否存在
|
||
if (Test-Path $SDKPath) {
|
||
Write-Host "✓ 检测到离线 SDK" -ForegroundColor Green
|
||
Write-Host ""
|
||
|
||
# 运行集成脚本
|
||
Write-Host "正在集成资源..." -ForegroundColor Yellow
|
||
& "$PSScriptRoot\integrate-to-android-studio.ps1"
|
||
|
||
Write-Host ""
|
||
Write-Host "========================================"
|
||
Write-Host " 下一步:"
|
||
Write-Host "========================================"
|
||
Write-Host "1. 打开 Android Studio" -ForegroundColor Cyan
|
||
Write-Host "2. File -> Open -> 选择:" -ForegroundColor Cyan
|
||
Write-Host " $SDKPath" -ForegroundColor Yellow
|
||
Write-Host "3. 等待 Gradle 同步" -ForegroundColor Cyan
|
||
Write-Host "4. 修改 build.gradle(参考 build.gradle.sample)" -ForegroundColor Cyan
|
||
Write-Host "5. Build -> Build APK(s)" -ForegroundColor Cyan
|
||
|
||
} else {
|
||
Write-Host "✗ 未检测到离线 SDK" -ForegroundColor Red
|
||
Write-Host ""
|
||
Write-Host "========================================"
|
||
Write-Host " 请先下载 uni-app Android 离线 SDK"
|
||
Write-Host "========================================"
|
||
Write-Host ""
|
||
Write-Host "步骤:" -ForegroundColor Yellow
|
||
Write-Host "1. 访问:https://nativesupport.dcloud.net.cn/AppDocs/download/android" -ForegroundColor Cyan
|
||
Write-Host "2. 下载最新版本(HBuilder-Integrate-AS.zip)" -ForegroundColor Cyan
|
||
Write-Host "3. 解压到:D:\SDK\HBuilder-Android\" -ForegroundColor Cyan
|
||
Write-Host ""
|
||
Write-Host "或者:" -ForegroundColor Yellow
|
||
Write-Host "- 修改此脚本中的 `$SDKPath 变量为你的实际路径" -ForegroundColor Cyan
|
||
Write-Host ""
|
||
Write-Host "下载完成后,再次运行此脚本" -ForegroundColor Green
|
||
Write-Host ""
|
||
|
||
# 询问是否打开下载页面
|
||
$answer = Read-Host "是否在浏览器中打开下载页面?(Y/N)"
|
||
if ($answer -eq "Y" -or $answer -eq "y") {
|
||
Start-Process "https://nativesupport.dcloud.net.cn/AppDocs/download/android"
|
||
}
|
||
}
|
||
|
||
Write-Host ""
|
||
Write-Host "详细指南请查看:下载SDK并打包指南.md" -ForegroundColor Gray
|
||
Write-Host ""
|