From cceff7e332a4b14d109b85579cc211871ef5e2d5 Mon Sep 17 00:00:00 2001 From: Lucas Fernandes Nogueira Date: Sat, 21 Oct 2023 11:23:25 -0300 Subject: [PATCH] fix(apple): do not list disconnected devices with devicectl (#247) --- .changes/fix-devicectl-status-check.md | 5 +++++ src/apple/device/devicectl/device_list.rs | 1 + 2 files changed, 6 insertions(+) create mode 100644 .changes/fix-devicectl-status-check.md diff --git a/.changes/fix-devicectl-status-check.md b/.changes/fix-devicectl-status-check.md new file mode 100644 index 00000000..c6ed0b61 --- /dev/null +++ b/.changes/fix-devicectl-status-check.md @@ -0,0 +1,5 @@ +--- +"cargo-mobile2": "patch" +--- + +Fix `devicectl` listing disconnected devices. \ No newline at end of file diff --git a/src/apple/device/devicectl/device_list.rs b/src/apple/device/devicectl/device_list.rs index 1c42ee92..406ddf4b 100644 --- a/src/apple/device/devicectl/device_list.rs +++ b/src/apple/device/devicectl/device_list.rs @@ -78,6 +78,7 @@ fn parse_device_list<'a>(json: String) -> Result>, DeviceLis .into_iter() .filter(|device| { device.connection_properties.tunnel_state != "unavailable" + && device.connection_properties.tunnel_state != "disconnected" && (device.hardware_properties.platform.contains("iOS") || device.hardware_properties.platform.contains("xrOS")) })