From 2a9983b1efde27242775229a3d4fbb6bdc6ec2ec Mon Sep 17 00:00:00 2001 From: Lawrence Lomax Date: Thu, 10 Feb 2022 07:56:49 -0800 Subject: [PATCH] Use Promise.all for checking xcode-select and apps in parallel Summary: These can be batched together rather nicely Reviewed By: lblasa Differential Revision: D34139753 fbshipit-source-id: 7388630dcae34d40308d54f18a37215cf18e5904 --- .../src/devices/ios/iOSDeviceManager.tsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/desktop/flipper-server-core/src/devices/ios/iOSDeviceManager.tsx b/desktop/flipper-server-core/src/devices/ios/iOSDeviceManager.tsx index 10f1d844a..a419d6808 100644 --- a/desktop/flipper-server-core/src/devices/ios/iOSDeviceManager.tsx +++ b/desktop/flipper-server-core/src/devices/ios/iOSDeviceManager.tsx @@ -192,11 +192,14 @@ export class IOSDeviceManager { async checkXcodeVersionMismatch() { try { - const {stdout: xcodeSelectStdout} = await exec('xcode-select -p'); + const [{stdout: xcodeSelectStdout}, {stdout: simulatorProcessStdout}] = + await Promise.all([ + exec('xcode-select -p'), + exec( + "pgrep Simulator | xargs ps -o command | grep -v grep | grep Simulator.app | awk '{print $1}'", + ), + ]); const xcodeCLIVersion = xcodeSelectStdout!.toString().trim(); - const {stdout: simulatorProcessStdout} = await exec( - "pgrep Simulator | xargs ps -o command | grep -v grep | grep Simulator.app | awk '{print $1}'", - ); const runningSimulatorApplications = simulatorProcessStdout! .toString() .split('\n')