Release script: do not take Android's own crash during an APK swap for the app's
When the release build is the emulator's home app, Android restarts it while the files are still being replaced, and that start can fail inside ActivityThread.handleBindApplication. The start-up check now waits for the swap to settle, stops the app, and judges a fresh start. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
1 parent
cef6929a41
commit
04e78205dd
1 file changed
+7
@@ -211,6 +211,13 @@ if ($NoSmokeTest) {
|
||||
if ($LASTEXITCODE -ne 0 -or -not ($install -match 'Success')) {
|
||||
throw "Could not install the APK on $emulator. If an older build signed with another key is installed there, uninstall it first: adb uninstall $AppId"
|
||||
}
|
||||
# When this app is the emulator's home app, Android restarts it the moment the old copy is
|
||||
# gone, and that first start can die inside Android itself while the files are still being
|
||||
# swapped (a NullPointerException in ActivityThread.handleBindApplication, with no line of
|
||||
# this app in it). That is not the new build crashing: let the swap settle, then start
|
||||
# from a clean slate and judge what happens from there.
|
||||
Start-Sleep -Seconds 6
|
||||
& $Adb -s $emulator shell am force-stop $AppId
|
||||
& $Adb -s $emulator logcat -b crash -c
|
||||
& $Adb -s $emulator shell am start -n $HomeActivity | Out-Null
|
||||
Write-Host "Installed on $emulator and started; watching for $SmokeTestSeconds seconds..."
|
||||
|
||||
Reference in new issue
Block a user