Skip to content

Commit 0839527

Browse files
zhongwuzwthymikee
authored andcommitted
fix: Add fallback path check when not found app file for iOS (#428)
1 parent 56cae62 commit 0839527

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/cli/src/commands/runIOS/runIOS.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,13 @@ function getBuildPath(configuration, appName, isDevice, scheme) {
355355
device = 'iphonesimulator';
356356
}
357357

358-
return `build/${scheme}/Build/Products/${configuration}-${device}/${appName}.app`;
358+
let buildPath = `build/${scheme}/Build/Products/${configuration}-${device}/${appName}.app`;
359+
// Check wether app file exist, sometimes `-derivedDataPath` option of `xcodebuild` not works as expected.
360+
if (!fs.existsSync(path.join(buildPath))) {
361+
return `DerivedData/Build/Products/${configuration}-${device}/${appName}.app`;
362+
}
363+
364+
return buildPath;
359365
}
360366
361367
function getProductName(buildOutput) {

0 commit comments

Comments
 (0)