From b7a9ad7ea8fe698a0d8cbbf0871e4b59eef91f5d Mon Sep 17 00:00:00 2001 From: Mykola Mokhnach Date: Sat, 13 Jul 2024 09:16:13 +0200 Subject: [PATCH] fix: Filter out other simulators properly for shutdown (#2429) --- lib/simulator-management.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/simulator-management.js b/lib/simulator-management.js index f27a653ec..cf60171f9 100644 --- a/lib/simulator-management.js +++ b/lib/simulator-management.js @@ -256,18 +256,18 @@ export async function shutdownOtherSimulators() { devicesSetPath: device.devicesSetPath, }); const allDevices = _.flatMap(_.values(await simctl.getDevices())); - const otherBootedDevices = allDevices.filter( - (device) => device.udid !== device.udid && device.state === 'Booted', - ); + const otherBootedDevices = allDevices + .filter(({udid, state}) => udid !== device.udid && state === 'Booted'); if (_.isEmpty(otherBootedDevices)) { this.log.info('No other running simulators have been detected'); return; } this.log.info( - `Detected ${otherBootedDevices.length} other running ${util.pluralize( - 'Simulator', + `Detected ${util.pluralize( + 'other running Simulator', otherBootedDevices.length, - )}.` + `Shutting them down...`, + true + )}. Shutting them down...`, ); for (const {udid} of otherBootedDevices) { // It is necessary to stop the corresponding xcodebuild process before killing