You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/workflows/ios.yml
+21-4Lines changed: 21 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -17,12 +17,29 @@ jobs:
17
17
- name: Build and Test
18
18
env:
19
19
scheme: ${{ 'SDKHostApp' }}
20
-
platform: ${{ 'iOS Simulator' }}
21
-
os: ${{ '16.2' }}
22
-
device: ${{ 'iPhone 13' }}
23
20
run: |
24
21
# xcrun xctrace returns via stderr, not the expected stdout (see https://developer.apple.com/forums/thread/663959)
22
+
25
23
if [ $scheme = default ]; then scheme=$(cat default); fi
24
+
25
+
# Determine file to build: .xcworkspace or .xcodeproj
26
26
if [ "`ls -A | grep -i \\.xcworkspace\$`" ]; then filetype_parameter="workspace" && file_to_build="`ls -A | grep -i \\.xcworkspace\$`"; else filetype_parameter="project" && file_to_build="`ls -A | grep -i \\.xcodeproj\$`"; fi
xcodebuild test -scheme "$scheme" -"$filetype_parameter" "$file_to_build" -destination "platform=$platform,OS=$os,name=$device"
30
+
31
+
# Find first available simulator
32
+
device_name=$(xcrun simctl list devices available | grep "iPhone" | head -n 1 | sed -E 's/^[[:space:]]*([^()]+)[[:space:]]*\(.*$/\1/' | awk '{$1=$1; print}')
0 commit comments