Skip to content

Commit

Permalink
fix: schema option on run-ios not installing and loading the right bu…
Browse files Browse the repository at this point in the history
…ndle (#128)
  • Loading branch information
misoguy authored and grabbou committed Jan 31, 2019
1 parent 62b11ff commit b33d079
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/cli/src/runIOS/runIOS.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const findReactNativeScripts = require('../util/findReactNativeScripts');
const parseIOSDevicesList = require('./parseIOSDevicesList');
const findMatchingSimulator = require('./findMatchingSimulator');

const getBuildPath = function(configuration = 'Debug', appName, isDevice) {
const getBuildPath = function(configuration = 'Debug', appName, isDevice, scheme) {
let device;

if (isDevice) {
Expand All @@ -28,7 +28,7 @@ const getBuildPath = function(configuration = 'Debug', appName, isDevice) {
device = 'iphonesimulator';
}

return `build/Build/Products/${configuration}-${device}/${appName}.app`;
return `build/${scheme}/Build/Products/${configuration}-${device}/${appName}.app`;
};
const xcprettyAvailable = function() {
try {
Expand Down Expand Up @@ -194,7 +194,7 @@ function runOnSimulator(xcodeProject, args, scheme) {
if (!appName) {
appName = scheme;
}
const appPath = getBuildPath(args.configuration, appName);
const appPath = getBuildPath(args.configuration, appName, false, scheme);
console.log(`Installing ${appPath}`);
child_process.spawnSync('xcrun', ['simctl', 'install', udid, appPath], {
stdio: 'inherit',
Expand Down Expand Up @@ -238,7 +238,7 @@ function runOnDevice(
}
const iosDeployInstallArgs = [
'--bundle',
getBuildPath(configuration, appName, true),
getBuildPath(configuration, appName, true, scheme),
'--id',
selectedDevice.udid,
'--justlaunch',
Expand Down Expand Up @@ -282,7 +282,7 @@ function buildProject(
'-destination',
`id=${udid}`,
'-derivedDataPath',
'build',
`build/${scheme}`,
];
console.log(`Building using "xcodebuild ${xcodebuildArgs.join(' ')}"`);
let xcpretty;
Expand Down

0 comments on commit b33d079

Please sign in to comment.