android: 恢复脚本+APK产物

This commit is contained in:
ZXCLI
2026-09-06 20:41:41 +08:00
parent 4fd2e5bf79
commit 6d0805af90
2 changed files with 34 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
# MAG160C 安卓APP会话恢复脚本
# 用法: powershell -ExecutionPolicy Bypass -File tools\resume_android.ps1
# 作用: 检查环境/构建/设备状态,重新构建APK,列出实机验证清单。
$proj = "C:\Project\MAG160C"
$andr = "$proj\android"
Write-Host "=== 1. 工具链 ==="
Write-Host "Java: $env:JAVA_HOME"
$gradle = "C:\Tools\gradle-8.14.3\bin\gradle.bat"
Write-Host "Gradle: $(Test-Path $gradle)"
Write-Host "SDK: $(Test-Path "$env:LOCALAPPDATA\Android\Sdk\platform-tools\adb.exe")"
Write-Host "=== 2. 设备 ==="
cmd /c "C:\Users\ZXC\AppData\Local\Android\Sdk\platform-tools\adb.exe devices"
Write-Host "=== 3. 构建 ==="
Push-Location $andr
$env:JAVA_HOME = "C:\Program Files\Zulu\zulu-21"
& $gradle :app:assembleDebug --no-daemon -q 2>&1 | Out-Null
Pop-Location
$apk = "$andr\app\build\outputs\apk\debug\app-debug.apk"
if (Test-Path $apk) {
Write-Host "构建 OK: $apk ($((Get-Item $apk).Length) 字节)"
Copy-Item $apk "$proj\build-artifacts\mag160c-app-debug.apk" -Force
} else { Write-Host "!!! 构建失败,运行: cd android; gradle :app:assembleDebug" }
Write-Host "=== 4. 实机验证清单 ==="
Write-Host "1. adb install mag160c-app-debug.apk"
Write-Host "2. 插入MAG160C -> 允许USB权限 -> 实时画面出图"
Write-Host "3. FFC/调色板/变倍/拍照/录像/媒体库/分析/PDF报告"
Write-Host "4. 横竖屏+深色模式"
Write-Host "详细状态: docs\android_app\session_state.md"