diff --git a/maa-cli/src/run/mod.rs b/maa-cli/src/run/mod.rs index d482cb5d..314daa87 100644 --- a/maa-cli/src/run/mod.rs +++ b/maa-cli/src/run/mod.rs @@ -140,28 +140,30 @@ where } }); - if let Some(app) = playcover.as_ref() { - app.open()?; - } + if !args.dry_run { + if let Some(app) = playcover.as_ref() { + app.open()?; + } - with_asst_config(|config| { - let (adb, addr, config) = config.connection.connect_args(); - asst.async_connect(adb, addr, config, true) - })?; + with_asst_config(|config| { + let (adb, addr, config) = config.connection.connect_args(); + asst.async_connect(adb, addr, config, true) + })?; - asst.start()?; + asst.start()?; - while asst.running() { - if stop_bool.load(atomic::Ordering::Relaxed) { - bail!("Interrupted by user!"); + while asst.running() { + if stop_bool.load(atomic::Ordering::Relaxed) { + bail!("Interrupted by user!"); + } + std::thread::sleep(std::time::Duration::from_millis(500)); } - std::thread::sleep(std::time::Duration::from_millis(500)); - } - asst.stop()?; + asst.stop()?; - if let Some(app) = playcover.as_ref() { - app.close()?; + if let Some(app) = playcover.as_ref() { + app.close()?; + } } // TODO: Better ways to restore signal handlers?