appium-xcuitest-driver
Version:
Appium driver for iOS using XCUITest for backend
26 lines • 899 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.isDeviceListedInUsbmux = isDeviceListedInUsbmux;
/**
* Returns true when the given UDID is present in usbmux device listing.
* On any failure (including failing to create the usbmux client), logs and returns false so callers can
* fall back to another strategy.
*/
async function isDeviceListedInUsbmux(remotexpc, udid, log) {
let usbmux;
try {
usbmux = await remotexpc.createUsbmux();
const devices = await usbmux.listDevices();
return devices.some((x) => x.Properties?.SerialNumber === udid);
}
catch (err) {
log?.debug?.(`Failed to query usbmux devices for '${udid}': ${err.message}`);
return false;
}
finally {
if (usbmux) {
await usbmux.close().catch(() => { });
}
}
}
//# sourceMappingURL=usbmux-utils.js.map