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
This commit is contained in:
Lawrence Lomax
2022-02-10 07:56:49 -08:00
committed by Facebook GitHub Bot
parent 84fac685ac
commit 2a9983b1ef

View File

@@ -192,11 +192,14 @@ export class IOSDeviceManager {
async checkXcodeVersionMismatch() { async checkXcodeVersionMismatch() {
try { try {
const {stdout: xcodeSelectStdout} = await exec('xcode-select -p'); const [{stdout: xcodeSelectStdout}, {stdout: simulatorProcessStdout}] =
const xcodeCLIVersion = xcodeSelectStdout!.toString().trim(); await Promise.all([
const {stdout: simulatorProcessStdout} = await exec( exec('xcode-select -p'),
exec(
"pgrep Simulator | xargs ps -o command | grep -v grep | grep Simulator.app | awk '{print $1}'", "pgrep Simulator | xargs ps -o command | grep -v grep | grep Simulator.app | awk '{print $1}'",
); ),
]);
const xcodeCLIVersion = xcodeSelectStdout!.toString().trim();
const runningSimulatorApplications = simulatorProcessStdout! const runningSimulatorApplications = simulatorProcessStdout!
.toString() .toString()
.split('\n') .split('\n')