From 58f4f1d71f68c9e44b54cb50e6f9bd4fdc9a7239 Mon Sep 17 00:00:00 2001 From: Benoit Lemaire Date: Tue, 9 Apr 2019 21:22:03 -0700 Subject: [PATCH] Improve iOS Runner build failure reporting --- ern-orchestrator/src/buildIosRunner.ts | 6 +++++- ern-orchestrator/src/launchRunner.ts | 8 +++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/ern-orchestrator/src/buildIosRunner.ts b/ern-orchestrator/src/buildIosRunner.ts index 5c64119eb..020d788bc 100644 --- a/ern-orchestrator/src/buildIosRunner.ts +++ b/ern-orchestrator/src/buildIosRunner.ts @@ -26,7 +26,11 @@ export async function buildIosRunner(pathToIosRunner: string, udid: string) { code === 0 ? resolve() : reject( - new Error(`XCode xcbuild command failed with exit code ${code}`) + new Error(`iOS Runner build failed [xcbuild exit code ${code}]. +To troubleshoot this build failure, we recommend building the Runner iOS project from XCode. +You can open the Runner project in XCode manually or by running 'open ios/ErnRunner.xcodeproj'. +Building the Runner from XCode will provide more meaningful error reporting that can be of help +to pinpoint the cause of the build failure.`) ) }) }) diff --git a/ern-orchestrator/src/launchRunner.ts b/ern-orchestrator/src/launchRunner.ts index b41665cfd..eabb51cec 100644 --- a/ern-orchestrator/src/launchRunner.ts +++ b/ern-orchestrator/src/launchRunner.ts @@ -25,9 +25,7 @@ async function launchAndroidRunner(pathToAndroidRunner: string) { async function launchIosRunner(pathToIosRunner: string) { const iosDevices = ios.getiPhoneRealDevices() - if (iosDevices && iosDevices.length > 0) { - launchOnDevice(pathToIosRunner, iosDevices) - } else { - launchOnSimulator(pathToIosRunner) - } + return iosDevices && iosDevices.length > 0 + ? launchOnDevice(pathToIosRunner, iosDevices) + : launchOnSimulator(pathToIosRunner) }