Skip to content

Commit 7f50a9e

Browse files
author
Fatme
authored
Throw an error when xcrun simctl command fails
Hanlde in a better way errors from xcrun command
1 parent 19019bb commit 7f50a9e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/simctl.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@ export class Simctl implements ISimctl {
137137

138138
private simctlExec(command: string, args: string[], opts?: any): string {
139139
const result = childProcess.spawnSync("xcrun", ["simctl", command].concat(args), opts);
140+
if (result && result.stderr && !_.isEmpty(result.stderr)) {
141+
throw new Error(`Error while executing command '${["xcrun", "simctl", command].concat(args).join(" ")}'. Please ensure your tools are configured correctly. More info: ${result.stderr.toString()}`);
142+
}
140143
if (result) {
141144
if (result.signal) {
142145
// In some cases, sending Ctrl + C (SIGINT) is handled by the simctl itself and spawnSync finishes, but the SIGINT does not stop current process.

0 commit comments

Comments
 (0)