Allows a user to specify an xcode scheme name.
Summary:When running `react-native run-ios`, this feature allows a user to specify which scheme to run. My project's scheme name is not the same as the xcode project name. Running `react-native run-ios` would error with the following: ``` ± |master ↓95 ✓| → react-native run-ios Found Xcode workspace Poot.xcworkspace Launching iPhone 6 (9.2)... Building using "xcodebuild -workspace Poot.xcworkspace -scheme Poot -destination id=2B3E8AAC-DD61-414C-95BD-F4829A8F7CE6 -derivedDataPath build" User defaults from command line: IDEDerivedDataPathOverride = /Users/mrickert/Documents/project/ios/build xcodebuild: error: The workspace named "Poot" does not contain a scheme named "Poot". The "-list" option can be used to find the names of the schemes in the workspace. Installing build/Build/Products/Debug-iphonesimulator/Poot.app An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2): Failed to install the requested application An application bundle was n Closes https://github.com/facebook/react-native/pull/6157 Differential Revision: D3020313 Pulled By: frantic fb-gh-sync-id: 9d99fa382b3f50045759acea18eff418b15d511d shipit-source-id: 9d99fa382b3f50045759acea18eff418b15d511d
This commit is contained in:
parent
fd3a0ba781
commit
62788a15f9
|
@ -33,6 +33,11 @@ function _runIOS(argv, config, resolve, reject) {
|
|||
type: 'string',
|
||||
required: false,
|
||||
default: 'iPhone 6',
|
||||
}, {
|
||||
command: 'scheme',
|
||||
description: 'Explicitly set Xcode scheme to use',
|
||||
type: 'string',
|
||||
required: false,
|
||||
}], argv);
|
||||
|
||||
process.chdir('ios');
|
||||
|
@ -42,6 +47,7 @@ function _runIOS(argv, config, resolve, reject) {
|
|||
}
|
||||
|
||||
const inferredSchemeName = path.basename(xcodeProject.name, path.extname(xcodeProject.name));
|
||||
const scheme = args.scheme || inferredSchemeName
|
||||
console.log(`Found Xcode ${xcodeProject.isWorkspace ? 'workspace' : 'project'} ${xcodeProject.name}`);
|
||||
|
||||
const simulators = parseIOSSimulatorsList(
|
||||
|
@ -63,7 +69,7 @@ function _runIOS(argv, config, resolve, reject) {
|
|||
|
||||
const xcodebuildArgs = [
|
||||
xcodeProject.isWorkspace ? '-workspace' : '-project', xcodeProject.name,
|
||||
'-scheme', inferredSchemeName,
|
||||
'-scheme', scheme,
|
||||
'-destination', `id=${selectedSimulator.udid}`,
|
||||
'-derivedDataPath', 'build',
|
||||
];
|
||||
|
|
Loading…
Reference in New Issue