diff --git a/flexera/release.ps1 b/flexera/release.ps1 index d0eaf780b0..5a2a7a7bab 100644 --- a/flexera/release.ps1 +++ b/flexera/release.ps1 @@ -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..."