From fede0b854ea9e880bb54a663e6d8d902424f8ca6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20B=C3=BCchele?= Date: Tue, 16 Oct 2018 06:34:22 -0700 Subject: [PATCH] iOS device availability Summary: Apple seems to have changed the key for device availablility. We check for both now. Reviewed By: jknoxville Differential Revision: D10401073 fbshipit-source-id: 284a168a701eb2d5d9b3cbcac2aa6276ee1a2211 --- src/dispatcher/iOSDevice.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/dispatcher/iOSDevice.js b/src/dispatcher/iOSDevice.js index b0b459fdf..5aebb97f7 100644 --- a/src/dispatcher/iOSDevice.js +++ b/src/dispatcher/iOSDevice.js @@ -15,7 +15,8 @@ import IOSDevice from '../devices/IOSDevice'; type iOSSimulatorDevice = {| state: 'Booted' | 'Shutdown' | 'Shutting Down', - availability: string, + availability?: string, + isAvailable?: 'YES' | 'NO', name: string, udid: string, |}; @@ -45,7 +46,10 @@ function querySimulatorDevices(store: Store): Promise { simulators.forEach((simulator: iOSSimulatorDevice) => { const isRunning = simulator.state === 'Booted' && - simulator.availability === '(available)'; + // For some users "availability" is set, for others it's "isAvailable" + // It's not clear which key is set, so we are checking both. + (simulator.availability === '(available)' || + simulator.isAvailable === 'YES'); if (isRunning && !currentDeviceIDs.has(simulator.udid)) { // create device