Skip to content

Commit

Permalink
fix: Filter out other simulators properly for shutdown (#2429)
Browse files Browse the repository at this point in the history
  • Loading branch information
mykola-mokhnach authored Jul 13, 2024
1 parent 08c80e9 commit b7a9ad7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/simulator-management.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b7a9ad7

Please sign in to comment.