Skip to content

Commit 569ccc6

Browse files
committed
ci: wait for online windows android emulator
1 parent 6a2e0d8 commit 569ccc6

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

.github/workflows/ci.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,7 @@ jobs:
408408
409409
$stdout = Join-Path $env:RUNNER_TEMP "simdeck-android-emulator.out.log"
410410
$stderr = Join-Path $env:RUNNER_TEMP "simdeck-android-emulator.err.log"
411+
$serial = "emulator-5554"
411412
$args = @(
412413
"-avd", "SimDeck_Pixel_CI",
413414
"-qt-hide-window",
@@ -456,7 +457,7 @@ jobs:
456457
throw "Android emulator exited early with code $($process.ExitCode)."
457458
}
458459
$devices = (& $adb devices)
459-
if ($devices -match "emulator-5554\s+(device|offline)") {
460+
if ($devices -match "$serial\s+device") {
460461
$deviceSeen = $true
461462
break
462463
}
@@ -472,7 +473,7 @@ jobs:
472473
Write-EmulatorDiagnostics
473474
throw "Android emulator exited early with code $($process.ExitCode)."
474475
}
475-
$booted = (& $adb shell getprop sys.boot_completed).Trim()
476+
$booted = (& $adb -s $serial shell getprop sys.boot_completed 2>$null | Out-String).Trim()
476477
if ($booted -eq "1") {
477478
break
478479
}
@@ -482,9 +483,9 @@ jobs:
482483
Write-EmulatorDiagnostics
483484
throw "Android emulator did not boot before the timeout."
484485
}
485-
& $adb shell settings put global window_animation_scale 0
486-
& $adb shell settings put global transition_animation_scale 0
487-
& $adb shell settings put global animator_duration_scale 0
486+
& $adb -s $serial shell settings put global window_animation_scale 0
487+
& $adb -s $serial shell settings put global transition_animation_scale 0
488+
& $adb -s $serial shell settings put global animator_duration_scale 0
488489
489490
- name: Android emulator integration tests (Windows)
490491
if: runner.os == 'Windows'

scripts/github-actions.test.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ test("Windows Android CI boot path is bounded and diagnostic", () => {
8686
assert.match(windowsBootStep, /"-feature", "-Vulkan"/);
8787
assert.match(windowsBootStep, /"-accel", "on"/);
8888
assert.match(windowsBootStep, /"-accel", "off"/);
89+
assert.match(windowsBootStep, /\$serial = "emulator-5554"/);
90+
assert.match(windowsBootStep, /\$devices -match "\$serial\\s\+device"/);
91+
assert.doesNotMatch(windowsBootStep, /device\|offline/);
8992
assert.match(windowsBootStep, /-RedirectStandardOutput \$stdout/);
9093
assert.match(windowsBootStep, /Write-EmulatorDiagnostics/);
9194
assert.match(

0 commit comments

Comments
 (0)