Skip to content

Commit bbc3b7a

Browse files
MateusAndradeMateusAndrade
andauthored
feat(ios): adding device_id and device_os for build command (#199)
* ci(ios): adding device_id and device_os for build command * ci(ios): adding default arguments --------- Co-authored-by: MateusAndrade <mateus.neri@xo-life.com>
1 parent 5525c5b commit bbc3b7a

File tree

2 files changed

+29
-2
lines changed

2 files changed

+29
-2
lines changed

src/commands/ios_build.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,17 @@ parameters:
1818
type: string
1919
default: "ios/build"
2020
device:
21-
description: The type of device you want to build for.
21+
description: The name of device you want to build for.
2222
type: string
2323
default: "iPhone 11"
24+
device_id:
25+
description: UUID of device you want to build for.
26+
type: string
27+
default: ""
28+
device_os:
29+
description: OS of device you want to build for, e.g 18.5.
30+
type: string
31+
default: ""
2432
scheme:
2533
description: The scheme to use.
2634
type: string
@@ -40,7 +48,16 @@ steps:
4048

4149
- run:
4250
name: Build iOS App
43-
command: "export RCT_NO_LAUNCH_PACKAGER=true && xcodebuild -<<parameters.project_type>> <<parameters.project_path>> -destination 'platform=iOS Simulator,name=<<parameters.device>>' -scheme '<<parameters.scheme>>' -parallelizeTargets -configuration <<parameters.build_configuration>> -derivedDataPath <<parameters.derived_data_path>> -UseModernBuildSystem=YES | xcpretty -k"
51+
command: |
52+
DESTINATION="platform=iOS Simulator,name=<<parameters.device>>"
53+
if [ "<<parameters.device_id>>" != "" ]; then
54+
DESTINATION="${DESTINATION},id=<<parameters.device_id>>"
55+
fi
56+
if [ "<<parameters.device_os>>" != "" ]; then
57+
DESTINATION="${DESTINATION},OS=<<parameters.device_os>>"
58+
fi
59+
export RCT_NO_LAUNCH_PACKAGER=true
60+
xcodebuild -<<parameters.project_type>> <<parameters.project_path>> -destination "${DESTINATION}" -scheme '<<parameters.scheme>>' -parallelizeTargets -configuration <<parameters.build_configuration>> -derivedDataPath <<parameters.derived_data_path>> -UseModernBuildSystem=YES | xcpretty -k
4461
4562
- when:
4663
condition: <<parameters.cache>>

src/jobs/ios_build.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,14 @@ parameters:
5555
description: The type of device you want to build for.
5656
type: string
5757
default: "iPhone 11"
58+
device_id:
59+
description: UUID of device you want to build for.
60+
type: string
61+
default: ""
62+
device_os:
63+
description: OS of device you want to build for, e.g 18.5.
64+
type: string
65+
default: ""
5866
scheme:
5967
description: The scheme to use.
6068
type: string
@@ -132,6 +140,8 @@ steps:
132140
project_path: <<parameters.project_path>>
133141
derived_data_path: <<parameters.derived_data_path>>
134142
device: <<parameters.device>>
143+
device_id: <<parameters.device_id>>
144+
device_os: <<parameters.device_os>>
135145
build_configuration: <<parameters.build_configuration>>
136146
scheme: <<parameters.scheme>>
137147
project_type: <<parameters.project_type>>

0 commit comments

Comments
 (0)