Register alpha.0 B4A prototype
This commit is contained in:
40
tools/deploy-emulator.ps1
Normal file
40
tools/deploy-emulator.ps1
Normal file
@@ -0,0 +1,40 @@
|
||||
param(
|
||||
[string]$ProjectRoot = (Resolve-Path "$PSScriptRoot\..").Path,
|
||||
[string]$AdbPath = "C:\android\platform-tools\adb.exe",
|
||||
[string]$PackageName = "anywheresoftware.b4a.swarm",
|
||||
[string]$MainActivity = ".main",
|
||||
[switch]$NoBuild,
|
||||
[switch]$NoLaunch,
|
||||
[switch]$KeepLogcat
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
if (-not (Test-Path -LiteralPath $AdbPath)) {
|
||||
throw "adb.exe non trovato: $AdbPath"
|
||||
}
|
||||
|
||||
if (-not $NoBuild) {
|
||||
& "$PSScriptRoot\build-b4a.ps1" -ProjectRoot $ProjectRoot
|
||||
}
|
||||
|
||||
$apkPath = Join-Path $ProjectRoot "Objects\swarm.apk"
|
||||
if (-not (Test-Path -LiteralPath $apkPath)) {
|
||||
throw "APK non trovato: $apkPath"
|
||||
}
|
||||
|
||||
& $AdbPath wait-for-device
|
||||
|
||||
if (-not $KeepLogcat) {
|
||||
& $AdbPath logcat -c
|
||||
}
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "Installo APK: $apkPath"
|
||||
& $AdbPath install -r -d $apkPath
|
||||
|
||||
if (-not $NoLaunch) {
|
||||
Write-Host ""
|
||||
Write-Host "Avvio app: $PackageName/$MainActivity"
|
||||
& $AdbPath shell am start -n "$PackageName/$MainActivity"
|
||||
}
|
||||
Reference in New Issue
Block a user