Commit 1c6b39b
feat(deploy): preserve app data on --native when signing key matches
adb_install_all ran an unconditional 'adb uninstall' before 'adb install',
wiping MOB_DATA_DIR (on-device identity, screen stores) on every native deploy
— even an in-place update signed with the same committed debug keystore.
Try 'adb install -r' first (preserves data when signatures match) and only
fall back to uninstall+install when the in-place update is genuinely rejected
(INSTALL_FAILED_UPDATE_INCOMPATIBLE, INSTALL_FAILED_VERSION_DOWNGRADE, ...).
Decision extracted to NativeBuild.needs_clean_reinstall?/2 and unit-tested.
Verified empirically: on the same device, 'mix mob.deploy --native' wiped the
seeded identity while a manual 'adb install -r' of the same keystore-signed APK
preserved it (firstInstallTime unchanged) — confirming the uninstall, not a
signature mismatch, was the cause.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 34c8d31 commit 1c6b39b
3 files changed
Lines changed: 69 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
11 | 28 | | |
12 | 29 | | |
13 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1232 | 1232 | | |
1233 | 1233 | | |
1234 | 1234 | | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
1235 | 1249 | | |
1236 | 1250 | | |
1237 | 1251 | | |
| |||
1250 | 1264 | | |
1251 | 1265 | | |
1252 | 1266 | | |
1253 | | - | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
1254 | 1274 | | |
1255 | 1275 | | |
1256 | | - | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
| 1286 | + | |
1257 | 1287 | | |
1258 | 1288 | | |
1259 | 1289 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1742 | 1742 | | |
1743 | 1743 | | |
1744 | 1744 | | |
| 1745 | + | |
| 1746 | + | |
| 1747 | + | |
| 1748 | + | |
| 1749 | + | |
| 1750 | + | |
| 1751 | + | |
| 1752 | + | |
| 1753 | + | |
| 1754 | + | |
| 1755 | + | |
| 1756 | + | |
| 1757 | + | |
| 1758 | + | |
| 1759 | + | |
| 1760 | + | |
| 1761 | + | |
| 1762 | + | |
| 1763 | + | |
| 1764 | + | |
1745 | 1765 | | |
0 commit comments