File tree Expand file tree Collapse file tree 4 files changed +23
-16
lines changed
packages/cli-platform-apple/src/commands Expand file tree Collapse file tree 4 files changed +23
-16
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ export type BuildFlags = {
1313 extraParams ?: string [ ] ;
1414 forcePods ?: boolean ;
1515 onlyPods ?: boolean ;
16+ device ?: string | true ;
1617} ;
1718
1819export const getBuildOptions = ( { platformName} : BuilderCommand ) => {
Original file line number Diff line number Diff line change @@ -52,6 +52,22 @@ export function buildProject(
5252 return ;
5353 }
5454
55+ const isDevice = args . device ;
56+ let destination = '' ;
57+ if ( udid ) {
58+ destination = `id=${ udid } ` ;
59+ } else if ( isDevice ) {
60+ destination = 'generic/platform=iOS' ;
61+ } else if ( mode === 'Debug' ) {
62+ destination = `generic/platform=${ simulatorDest } ` ;
63+ } else {
64+ destination = `generic/platform=${ platform } ` ;
65+ }
66+
67+ if ( args . destination ) {
68+ destination += `,${ args . destination } ` ;
69+ }
70+
5571 const xcodebuildArgs = [
5672 xcodeProject . isWorkspace ? '-workspace' : '-project' ,
5773 xcodeProject . name ,
@@ -62,12 +78,7 @@ export function buildProject(
6278 '-scheme' ,
6379 scheme ,
6480 '-destination' ,
65- ( udid
66- ? `id=${ udid } `
67- : mode === 'Debug'
68- ? `generic/platform=${ simulatorDest } `
69- : `generic/platform=${ platform } ` ) +
70- ( args . destination ? ',' + args . destination : '' ) ,
81+ destination ,
7182 ] ;
7283
7384 if ( args . extraParams ) {
Original file line number Diff line number Diff line change @@ -39,7 +39,6 @@ import openApp from './openApp';
3939
4040export interface FlagsT extends BuildFlags {
4141 simulator ?: string ;
42- device ?: string | true ;
4342 udid ?: string ;
4443 binaryPath ?: string ;
4544 listDevices ?: boolean ;
Original file line number Diff line number Diff line change @@ -38,17 +38,13 @@ export async function getBuildSettings(
3838
3939 // Find all 'app' targets in the build settings
4040 const applicationTargets = settings
41- . filter (
42- ( setting : any ) =>
43- setting . buildSettings . WRAPPER_EXTENSION ===
44- 'app' ,
45- )
41+ . filter ( ( setting : any ) => setting . buildSettings . WRAPPER_EXTENSION === 'app' )
4642 . map ( ( { target : settingsTarget } : any ) => settingsTarget ) ;
4743
48- if ( applicationTargets . length === 0 ) return null
49-
44+ if ( applicationTargets . length === 0 ) return null ;
45+
5046 let selectedTarget = applicationTargets [ 0 ] ;
51-
47+
5248 if ( target ) {
5349 if ( ! applicationTargets . includes ( target ) ) {
5450 logger . info (
@@ -60,7 +56,7 @@ export async function getBuildSettings(
6056 selectedTarget = target ;
6157 }
6258 }
63-
59+
6460 const targetIndex = applicationTargets . indexOf ( selectedTarget ) ;
6561 return settings [ targetIndex ] . buildSettings ;
6662}
You can’t perform that action at this time.
0 commit comments