Skip to content

Commit 1b32852

Browse files
Properly spawn and shutdown both, adb and the emulator
1 parent e46281d commit 1b32852

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

utils/build.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1902,16 +1902,14 @@ function Test-Dispatch([Platform]$Platform) {
19021902
-RedirectStandardOutput "$NDKDir\.temp\emulator.out" `
19031903
-RedirectStandardError "$NDKDir\.temp\emulator.err"
19041904

1905-
# TODO: Find a better indicator than a upper-bound delay
1906-
Start-Sleep -Seconds 5
1907-
19081905
# This is just a hack for now
19091906
$LocalBin = (Get-TargetProjectBinaryCache $AndroidX64 Dispatch)
19101907
$CacheName = Split-Path $LocalBin -Leaf
19111908
$RemoteBin = "/data/local/tmp/$CacheName"
19121909

19131910
# TODO: On my local machine I have to grant network access once. How to do that in CI?
19141911
$adb = "$NDKDir\platform-tools\adb.exe"
1912+
Invoke-Program $adb "wait-for-device"
19151913
Write-Host "$adb shell rm -rf $RemoteBin"
19161914
Invoke-Program $adb shell "rm -rf $RemoteBin"
19171915
Write-Host "$adb shell mkdir $RemoteBin"
@@ -1924,6 +1922,8 @@ function Test-Dispatch([Platform]$Platform) {
19241922
Invoke-Program $adb shell "chmod +x /data/local/tmp/ctest_mock.sh"
19251923
Write-Host "$adb shell sh /data/local/tmp/ctest_mock.sh $RemoteBin"
19261924
Invoke-Program $adb shell "sh /data/local/tmp/ctest_mock.sh $RemoteBin"
1925+
Invoke-Program $adb emu kill
1926+
Invoke-Program $adb kill-server
19271927
}
19281928

19291929
function Build-Foundation([Platform]$Platform, $Arch, [switch]$Test = $false) {

0 commit comments

Comments
 (0)