Skip to content

Commit 2d614fa

Browse files
committed
feat(ios): Ensure a simulator with the latest iOS version exists for the given name when testing
1 parent 830659e commit 2d614fa

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/commands/ios_simulator_start.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
description: Starts an iOS simulator with the given name.
1+
description: Creates and starts an iOS simulator with the given name.
22

33
parameters:
44
device:
@@ -7,6 +7,12 @@ parameters:
77
default: "iPhone X"
88

99
steps:
10+
- run:
11+
name: Remove all simulators to avoid conflicts with the one we're going to use
12+
command: xcrun simctl list | awk -F “[()]” ‘{ for (i=2; i<NF; i+=2) print $i }’ | grep ‘^[-A-Z0–9]*$’ | xargs -I uuid xcrun simctl delete uuid
13+
- run:
14+
name: Create the device simulator we need
15+
command: xcrun simctl create "<<parameters.device>>" "<<parameters.device>>"
1016
- run:
1117
name: Start iOS simulator (background)
1218
background: true

0 commit comments

Comments
 (0)