Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ To keep dependency bloat and compile time down, everything is contained in featu
| `tunneld` | Interface with [pymobiledevice3](https://github.com/doronz88/pymobiledevice3)'s tunneld. |
| `usbmuxd` | Connect using the usbmuxd daemon.|
| `xpc` | Access protected services via XPC over RSD. |
| `xctest` | Launch XCTest runners and coordinate modern testmanagerd/XCTest sessions. |
| `wda` | Minimal WebDriverAgent bootstrap helpers and localhost bridge support. |
| `notification_proxy` | Post and observe iOS notifications. |

### Planned/TODO
Expand Down Expand Up @@ -146,6 +148,28 @@ async fn main() {

More examples are in the [`tools`](tools/) crate and in the crate documentation.

### XCTest / WDA

`idevice` also includes support for launching XCTest runners through the
library's modern DVT/RSD path. This can be used to start
WebDriverAgent-style runners on recent iOS versions.

The bundled CLI exposes this through the `idevice-tools xctest` command:

```bash
idevice-tools --udid <device-udid> xctest io.github.kor1k1.WebDriverAgentRunner.xctrunner
```

To wait for WDA and expose localhost bridge URLs for HTTP and MJPEG:

```bash
idevice-tools --udid <device-udid> xctest --bridge io.github.kor1k1.WebDriverAgentRunner.xctrunner
```

The current `wda` support is intentionally a bootstrap layer for readiness
checks and session startup, rather than a complete long-lived WebDriver
client.

## FFI

For use in other languages, a small FFI crate has been created to start exposing
Expand Down
4 changes: 1 addition & 3 deletions ffi/src/dvt/remote_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,7 @@ pub unsafe extern "C" fn remote_server_connect_rsd(

match res {
Ok(d) => {
let boxed = Box::new(RemoteServerHandle(RemoteServerClient::new(Box::new(
d.into_inner(),
))));
let boxed = Box::new(RemoteServerHandle(d));
unsafe { *handle = Box::into_raw(boxed) };
null_mut()
}
Expand Down
4 changes: 4 additions & 0 deletions idevice/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,13 @@ installation_proxy = [
"tokio/fs",
]
installcoordination_proxy = []
xctest = ["dvt", "installation_proxy", "afc", "dep:uuid", "dep:ns-keyed-archive", "tunnel_tcp_stack", "rsd", "core_device_proxy"]
springboardservices = []
misagent = []
mobile_image_mounter = ["dep:sha2"]
mobileactivationd = ["dep:reqwest"]
mobilebackup2 = []
wda = ["dep:serde_json", "tokio/time", "tokio/net"]
notification_proxy = [
"tokio/macros",
"tokio/time",
Expand Down Expand Up @@ -170,11 +172,13 @@ full = [
"house_arrest",
"installation_proxy",
"installcoordination_proxy",
"xctest",
"location_simulation",
"misagent",
"mobile_image_mounter",
"mobileactivationd",
"mobilebackup2",
"wda",
"notification_proxy",
"pair",
"pcapd",
Expand Down
24 changes: 24 additions & 0 deletions idevice/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,22 @@ pub enum IdeviceError {
#[cfg(feature = "installation_proxy")]
#[error("Application verification failed: {0}")]
ApplicationVerificationFailed(String),

#[cfg(feature = "xctest")]
#[error("application is not installed on the device")]
AppNotInstalled,

#[cfg(feature = "xctest")]
#[error("test runner did not connect within the timeout")]
TestRunnerTimeout,

#[cfg(feature = "xctest")]
#[error("test runner disconnected before the test plan completed")]
TestRunnerDisconnected,

#[cfg(feature = "xctest")]
#[error("xctest session timed out after {0:.1}s")]
XcTestTimeout(f64),
}

impl IdeviceError {
Expand Down Expand Up @@ -995,6 +1011,14 @@ impl IdeviceError {
IdeviceError::NotificationProxyDeath => 202,
#[cfg(feature = "installation_proxy")]
IdeviceError::ApplicationVerificationFailed(_) => 203,
#[cfg(feature = "xctest")]
IdeviceError::AppNotInstalled => 204,
#[cfg(feature = "xctest")]
IdeviceError::TestRunnerTimeout => 205,
#[cfg(feature = "xctest")]
IdeviceError::TestRunnerDisconnected => 206,
#[cfg(feature = "xctest")]
IdeviceError::XcTestTimeout(_) => 207,
}
}

Expand Down
2 changes: 1 addition & 1 deletion idevice/src/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ impl IdeviceProvider for TcpProvider {

/// USB-based device connection provider using usbmuxd
#[cfg(feature = "usbmuxd")]
#[derive(Debug)]
#[derive(Debug, Clone)]
pub struct UsbmuxdProvider {
/// USB connection address
pub addr: UsbmuxdAddr,
Expand Down
Loading
Loading