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 = {
13
13
extraParams ?: string [ ] ;
14
14
forcePods ?: boolean ;
15
15
onlyPods ?: boolean ;
16
+ device ?: string | true ;
16
17
} ;
17
18
18
19
export const getBuildOptions = ( { platformName} : BuilderCommand ) => {
Original file line number Diff line number Diff line change @@ -52,6 +52,22 @@ export function buildProject(
52
52
return ;
53
53
}
54
54
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
+
55
71
const xcodebuildArgs = [
56
72
xcodeProject . isWorkspace ? '-workspace' : '-project' ,
57
73
xcodeProject . name ,
@@ -62,12 +78,7 @@ export function buildProject(
62
78
'-scheme' ,
63
79
scheme ,
64
80
'-destination' ,
65
- ( udid
66
- ? `id=${ udid } `
67
- : mode === 'Debug'
68
- ? `generic/platform=${ simulatorDest } `
69
- : `generic/platform=${ platform } ` ) +
70
- ( args . destination ? ',' + args . destination : '' ) ,
81
+ destination ,
71
82
] ;
72
83
73
84
if ( args . extraParams ) {
Original file line number Diff line number Diff line change @@ -39,7 +39,6 @@ import openApp from './openApp';
39
39
40
40
export interface FlagsT extends BuildFlags {
41
41
simulator ?: string ;
42
- device ?: string | true ;
43
42
udid ?: string ;
44
43
binaryPath ?: string ;
45
44
listDevices ?: boolean ;
Original file line number Diff line number Diff line change @@ -38,17 +38,13 @@ export async function getBuildSettings(
38
38
39
39
// Find all 'app' targets in the build settings
40
40
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' )
46
42
. map ( ( { target : settingsTarget } : any ) => settingsTarget ) ;
47
43
48
- if ( applicationTargets . length === 0 ) return null
49
-
44
+ if ( applicationTargets . length === 0 ) return null ;
45
+
50
46
let selectedTarget = applicationTargets [ 0 ] ;
51
-
47
+
52
48
if ( target ) {
53
49
if ( ! applicationTargets . includes ( target ) ) {
54
50
logger . info (
@@ -60,7 +56,7 @@ export async function getBuildSettings(
60
56
selectedTarget = target ;
61
57
}
62
58
}
63
-
59
+
64
60
const targetIndex = applicationTargets . indexOf ( selectedTarget ) ;
65
61
return settings [ targetIndex ] . buildSettings ;
66
62
}
You can’t perform that action at this time.
0 commit comments