From 45edfd061b2e8878d78da89ac4b8e6498453f573 Mon Sep 17 00:00:00 2001 From: Vytenis Date: Wed, 4 Mar 2020 11:00:05 +0200 Subject: [PATCH] fix: pick correct TARGET_BUILD_DIR for run-ios (#1032) * ci: fix wrong TARGET_BUILD_DIR * ci: better version of detecting right build settings --- .../platform-ios/src/commands/runIOS/index.ts | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/packages/platform-ios/src/commands/runIOS/index.ts b/packages/platform-ios/src/commands/runIOS/index.ts index 4024eb28b..d56db46c7 100644 --- a/packages/platform-ios/src/commands/runIOS/index.ts +++ b/packages/platform-ios/src/commands/runIOS/index.ts @@ -368,10 +368,17 @@ function bootSimulator(selectedSimulator: Device) { } function getTargetBuildDir(buildSettings: string) { - const targetBuildMatch = /TARGET_BUILD_DIR = (.+)$/m.exec(buildSettings); - return targetBuildMatch && targetBuildMatch[1] - ? targetBuildMatch[1].trim() - : null; + const settings = JSON.parse(buildSettings); + + // Find app in all building settings - look for WRAPPER_EXTENSION: 'app', + for (const i in settings) { + const wrapperExtension = settings[i].buildSettings.WRAPPER_EXTENSION; + if (wrapperExtension === 'app') { + return settings[i].buildSettings.TARGET_BUILD_DIR; + } + } + + return null; } function getBuildPath( @@ -403,6 +410,7 @@ function getBuildPath( '-configuration', configuration, '-showBuildSettings', + '-json', ], {encoding: 'utf8'}, );