Skip to content

Commit

Permalink
fix(android): use install -r to try and replace existing apk (#283)
Browse files Browse the repository at this point in the history
* Fixes tauri-apps/tauri#9067 adding replace flag to ADB command

* change file
  • Loading branch information
TylerJMcLean committed Mar 7, 2024
1 parent 5a84ab2 commit 7a1066c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changes/adb-replace.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"cargo-mobile2": patch
---

Use `adb install -r` to try replacing the android application while installing it on the device. This elimnates the need to uninstall the application from a previous run when using a real device.
2 changes: 1 addition & 1 deletion src/android/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ impl<'a> Device<'a> {

self.adb(env)
.before_spawn(move |cmd| {
cmd.arg("install");
cmd.args(["install", "-r"]);
cmd.arg(&apk_path);
Ok(())
})
Expand Down

0 comments on commit 7a1066c

Please sign in to comment.