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: add target configuration #6192

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions cli/src/config.ts
Expand Up @@ -281,6 +281,7 @@ async function loadIOSConfig(
const platformDir = extConfig.ios?.path ?? 'ios';
const platformDirAbs = resolve(rootDir, platformDir);
const scheme = extConfig.ios?.scheme ?? 'App';
const target = extConfig.ios?.target ?? scheme;
const nativeProjectDir = 'App';
const nativeProjectDirAbs = resolve(platformDirAbs, nativeProjectDir);
const nativeTargetDir = `${nativeProjectDir}/App`;
Expand Down Expand Up @@ -312,6 +313,7 @@ async function loadIOSConfig(
platformDir,
platformDirAbs,
scheme,
target,
cordovaPluginsDir,
cordovaPluginsDirAbs: resolve(platformDirAbs, cordovaPluginsDir),
nativeProjectDir,
Expand Down
15 changes: 15 additions & 0 deletions cli/src/declarations.ts
Expand Up @@ -295,6 +295,21 @@ export interface CapacitorConfig {
*/
scheme?: string;

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

/**
* User agent of Capacitor Web View on iOS.
*
Expand Down
1 change: 1 addition & 0 deletions cli/src/definitions.ts
Expand Up @@ -112,6 +112,7 @@ export interface IOSConfig extends PlatformConfig {
readonly minVersion: string;
readonly podPath: Promise<string>;
readonly scheme: string;
readonly target: string;
readonly webDir: Promise<string>;
readonly webDirAbs: Promise<string>;
readonly nativeProjectDir: string;
Expand Down
2 changes: 1 addition & 1 deletion cli/src/ios/run.ts
Expand Up @@ -48,7 +48,7 @@ export async function runIOS(
}),
);

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