From 6a16ad7f155a2611a18a95323a62bf718629a222 Mon Sep 17 00:00:00 2001 From: Sashanoraa Date: Thu, 15 May 2025 13:44:29 -0400 Subject: [PATCH] Add special case for PermissionDenied on macOS On macOS this can mean the device is busy. --- Cargo.lock | 4 ++-- installer/src/orbic.rs | 11 +++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8c1dce4..fb05969 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5,7 +5,7 @@ version = 4 [[package]] name = "adb_client" version = "2.1.11" -source = "git+https://github.com/gaykitty/adb_client.git?branch=rayhunter#6a8054f0e04be9d669e06631e23882e6403d6e1e" +source = "git+https://github.com/gaykitty/adb_client.git?branch=rayhunter#1fb0f4f5cbcc95bbbb98db4ee2f1e53a1005aa81" dependencies = [ "async-io", "base64", @@ -585,7 +585,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "117725a109d387c937a1533ce01b450cbde6b88abceea8473c4d7a85853cda3c" dependencies = [ "lazy_static", - "windows-sys 0.59.0", + "windows-sys 0.48.0", ] [[package]] diff --git a/installer/src/orbic.rs b/installer/src/orbic.rs index c74c4ea..aaf2017 100644 --- a/installer/src/orbic.rs +++ b/installer/src/orbic.rs @@ -24,6 +24,13 @@ const ORBIC_BUSY: &str = r#"The Orbic is plugged in but is being used by another Please close any program that might be using your USB devices. If you have adb installed you may need to kill the adb daemon"#; +#[cfg(target_os = "macos")] +const ORBIC_BUSY_MAC: &str = r#"Permission denied. + +On macOS this might be caused by another program using the Orbic. +Please close any program that might be using your Orbic. +If you have adb installed you may need to kill the adb daemon"#; + const VENDOR_ID: u16 = 0x05c6; const PRODUCT_ID: u16 = 0xf601; @@ -251,6 +258,10 @@ async fn wait_for_adb_shell() -> Result { Err(RustADBError::IOError(e)) if e.kind() == ErrorKind::ResourceBusy => { bail!(ORBIC_BUSY); } + #[cfg(target_os = "macos")] + Err(RustADBError::IOError(e)) if e.kind() == ErrorKind::PermissionDenied => { + bail!(ORBIC_BUSY_MAC); + } Err(RustADBError::DeviceNotFound(_)) => { wait_for_usb_device(VENDOR_ID, PRODUCT_ID).await?; }