forked from lelemka0/MiPushFramework
-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathdeploy.ps1
More file actions
26 lines (22 loc) · 777 Bytes
/
deploy.ps1
File metadata and controls
26 lines (22 loc) · 777 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
param([switch]$Debug, [switch]$Vc105)
Write-Host "Checking for uncommitted changes" -ForegroundColor Green
[string]$res = git status --porcelain
if ($res) {
Write-Host "Commit changes before deploying" -ForegroundColor Red
return;
}
Write-Host "Validating build" -ForegroundColor Green
./build
if ($LASTEXITCODE -ne 0) {
return
}
$ver = if ($Vc105) { 'vc105' } else { 'normal' }
$type = if ($Debug) { 'debug' } else { 'release' }
$file = ls .\push\build\outputs\apk\$ver\$type\*.apk
$path = $file.FullName
Write-Host "Deploying $path" -ForegroundColor Green
$devices = adb devices | % { if ($null = $_ -match '^(\S+)\s+device$') { $Matches[1] } }
foreach ($device in $devices) {
Write-Host "Deploying for $device" -ForegroundColor Green
adb -s $device install $path
}