Skip to content

Commit bcb940c

Browse files
authored
Improve extraction of iOS simulator details
Refactor the method for extracting device name and OS version from the simulator list.
1 parent 1f74d1b commit bcb940c

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

.github/workflows/swift.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,15 @@ jobs:
1717
- name: Get latest iOS simulator destination
1818
id: simulator
1919
run: |
20-
# 사용 가능한 시뮬레이터 목록에서 최신 모델+OS 선택
2120
LINE=$(xcrun simctl list devices available |
2221
grep -E 'iPhone|iPad' |
2322
grep -v "unavailable" |
2423
sort -t, -k2 -r |
2524
head -1)
26-
27-
# 예시 LINE: "iPhone 16 Pro (18.1) [UUID]"
28-
DEVICE_NAME=$(echo "$LINE" | awk -F ' \(' '{print $1}')
29-
OS_VERSION=$(echo "$LINE" | awk -F '[()]' '{print $2}')
30-
25+
26+
DEVICE_NAME=$(echo "$LINE" | sed -E 's/ \([0-9.]+\).*//')
27+
OS_VERSION=$(echo "$LINE" | sed -E 's/.*\(([0-9.]+)\).*/\1/')
28+
3129
DEST="platform=iOS Simulator,OS=$OS_VERSION,name=$DEVICE_NAME"
3230
echo "DESTINATION=$DEST" >> $GITHUB_ENV
3331
echo "Selected destination: $DEST"

0 commit comments

Comments
 (0)