Skip to content

Commit 83ed090

Browse files
authored
fix(cli): do not exit mobile dev if logger could not be attached (#10790)
I just faced this when I was connected to my iPhone but wireless. Xcode also lets this happen, you only miss the logs in this case.
1 parent 84070ba commit 83ed090

File tree

3 files changed

+8
-16
lines changed

3 files changed

+8
-16
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"tauri-cli": patch:bug
3+
"@tauri-apps/cli": patch:bug
4+
---
5+
6+
Do not quit `ios dev` and `android dev` process when we fail to attach the logger.

tooling/cli/src/mobile/android/dev.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,6 @@ fn run_dev(
212212
)?;
213213

214214
let open = options.open;
215-
let exit_on_panic = options.exit_on_panic;
216-
let no_watch = options.no_watch;
217215
interface.mobile_dev(
218216
MobileOptions {
219217
debug: !options.release_mode,
@@ -247,12 +245,7 @@ fn run_dev(
247245
open_and_wait(config, &env)
248246
} else if let Some(device) = &device {
249247
match run(device, options, config, &env, metadata, noise_level) {
250-
Ok(c) => {
251-
crate::dev::wait_dev_process(c.clone(), move |status, reason| {
252-
crate::dev::on_app_exit(status, reason, exit_on_panic, no_watch)
253-
});
254-
Ok(Box::new(c) as Box<dyn DevProcess + Send>)
255-
}
248+
Ok(c) => Ok(Box::new(c) as Box<dyn DevProcess + Send>),
256249
Err(e) => {
257250
crate::dev::kill_before_dev_process();
258251
Err(e)

tooling/cli/src/mobile/ios/dev.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -369,8 +369,6 @@ fn run_dev(
369369
let set_host = options.host.is_some();
370370

371371
let open = options.open;
372-
let exit_on_panic = options.exit_on_panic;
373-
let no_watch = options.no_watch;
374372
interface.mobile_dev(
375373
MobileOptions {
376374
debug: true,
@@ -401,12 +399,7 @@ fn run_dev(
401399
open_and_wait(config, &env)
402400
} else if let Some(device) = &device {
403401
match run(device, options, config, &env) {
404-
Ok(c) => {
405-
crate::dev::wait_dev_process(c.clone(), move |status, reason| {
406-
crate::dev::on_app_exit(status, reason, exit_on_panic, no_watch)
407-
});
408-
Ok(Box::new(c) as Box<dyn DevProcess + Send>)
409-
}
402+
Ok(c) => Ok(Box::new(c) as Box<dyn DevProcess + Send>),
410403
Err(e) => {
411404
crate::dev::kill_before_dev_process();
412405
Err(e)

0 commit comments

Comments
 (0)