Skip to content

Commit 5dcbb5c

Browse files
GenericJamclaude
andcommitted
deploy: word the clean-reinstall notice to match what actually happens
The fallback printed "In-place update rejected — reinstalling clean (app data will be cleared)" for any `install -r` failure, including a transient adb error (e.g. device offline) where nothing is rejected and the follow-up uninstall+install just re-fails without clearing data. Split the notice: only a genuine package-state rejection (an INSTALL_FAILED line, i.e. signature/version mismatch) claims app data will be cleared; a non-zero exit without INSTALL_FAILED reports the adb exit code and "retrying with a clean install". Also drops the em-dash from user-facing output. Behaviour is unchanged; wording only. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 1c6b39b commit 5dcbb5c

1 file changed

Lines changed: 16 additions & 4 deletions

File tree

lib/mob_dev/native_build.ex

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1274,10 +1274,22 @@ defmodule MobDev.NativeBuild do
12741274

12751275
{install_out, install_rc} =
12761276
if needs_clean_reinstall?(first_out, first_rc) do
1277-
IO.puts(
1278-
" #{IO.ANSI.yellow()}In-place update rejected — reinstalling clean " <>
1279-
"(app data will be cleared)#{IO.ANSI.reset()}"
1280-
)
1277+
# Distinguish a genuine package-state rejection (signature or
1278+
# version mismatch) from a transient adb error (e.g. device
1279+
# offline): a clean reinstall reliably clears app data only in the
1280+
# former case, so word the notice accordingly rather than always
1281+
# promising "app data will be cleared".
1282+
if String.contains?(first_out, "INSTALL_FAILED") do
1283+
IO.puts(
1284+
" #{IO.ANSI.yellow()}In-place update rejected (signature or version " <>
1285+
"mismatch), reinstalling clean (app data will be cleared)#{IO.ANSI.reset()}"
1286+
)
1287+
else
1288+
IO.puts(
1289+
" #{IO.ANSI.yellow()}In-place update failed (adb exit #{first_rc}), " <>
1290+
"retrying with a clean install#{IO.ANSI.reset()}"
1291+
)
1292+
end
12811293

12821294
System.cmd("adb", ["-s", serial, "uninstall", bundle_id], stderr_to_stdout: true)
12831295
System.cmd("adb", ["-s", serial, "install", apk], stderr_to_stdout: true)

0 commit comments

Comments
 (0)