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

feat(cli): configurable iOS build scheme #4073

Merged
merged 2 commits into from
Jan 19, 2021
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions cli/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ async function loadIOSConfig(
const podPath = determineCocoapodPath();
const platformDir = extConfig.ios?.path ?? 'ios';
const platformDirAbs = resolve(rootDir, platformDir);
const scheme = extConfig.ios?.scheme ?? 'App';
const nativeProjectDir = 'App';
const nativeProjectDirAbs = resolve(platformDirAbs, nativeProjectDir);
const nativeTargetDir = `${nativeProjectDir}/App`;
Expand All @@ -285,6 +286,7 @@ async function loadIOSConfig(
minVersion: '12.0',
platformDir,
platformDirAbs,
scheme,
cordovaPluginsDir,
cordovaPluginsDirAbs: resolve(platformDirAbs, cordovaPluginsDir),
nativeProjectDir,
Expand Down
15 changes: 15 additions & 0 deletions cli/src/declarations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,21 @@ export interface CapacitorConfig {
*/
path?: string;

/**
* iOS build scheme to use.
*
* Usually this matches your app's target in Xcode. You can use the
* following command to list schemes:
*
* ```shell
* xcodebuild -workspace ios/App/App.xcworkspace -list
* ```
*
* @since 3.0.0
* @default App
*/
scheme?: string;

/**
* User agent of Capacitor Web View on iOS.
*
Expand Down
1 change: 1 addition & 0 deletions cli/src/definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ export interface IOSConfig extends PlatformConfig {
readonly cordovaPluginsDirAbs: string;
readonly minVersion: string;
readonly podPath: string;
readonly scheme: string;
readonly webDir: Promise<string>;
readonly webDirAbs: Promise<string>;
readonly nativeProjectDir: string;
Expand Down
4 changes: 2 additions & 2 deletions cli/src/ios/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export async function runIOS(
'-workspace',
basename(await config.ios.nativeXcodeWorkspaceDirAbs),
'-scheme',
'App',
config.ios.scheme,
'-configuration',
'Debug',
'-destination',
Expand All @@ -46,7 +46,7 @@ export async function runIOS(
}),
);

const appName = 'App.app';
const appName = `${config.ios.scheme}.app`;
const appPath = resolve(
derivedDataPath,
'Build/Products',
Expand Down