Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: schema option on run-ios not installing and loading the right bundle #128

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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`;
grabbou marked this conversation as resolved.
Show resolved Hide resolved
};
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}`,
thymikee marked this conversation as resolved.
Show resolved Hide resolved
];
console.log(`Building using "xcodebuild ${xcodebuildArgs.join(' ')}"`);
let xcpretty;
Expand Down