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
+14-11Lines changed: 14 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -27,25 +27,28 @@ jobs:
27
27
scheme: ${{ 'default' }}
28
28
platform: ${{ 'iOS Simulator' }}
29
29
run: |
30
-
# xcrun xctrace returns via stderr, not the expected stdout (see https://developer.apple.com/forums/thread/663959)
31
-
device=`xcrun xctrace list devices 2>&1 | grep -oE 'iPhone.*?[^\(]+' | head -1 | awk '{$1=$1;print}' | sed -e "s/ Simulator$//"`
30
+
device_id=$(xcrun simctl list devices available | grep "iPhone 16" | head -1 | sed -E 's/.*\(([A-Z0-9-]+)\).*/\1/')
31
+
if [ -z "$device_id" ]; then
32
+
echo "No iPhone 16 simulator found, use another simulator"
33
+
device_id=$(xcrun simctl list devices available | grep "iPhone" | head -1 | sed -E 's/.*\(([A-Z0-9-]+)\).*/\1/')
34
+
fi
35
+
echo "Use simulator with ID: $device_id"
32
36
if [ $scheme = default ]; then scheme=$(cat default); fi
33
37
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
# xcrun xctrace returns via stderr, not the expected stdout (see https://developer.apple.com/forums/thread/663959)
42
-
device=`xcrun xctrace list devices 2>&1 | grep -oE 'iPhone.*?[^\(]+' | head -1 | awk '{$1=$1;print}' | sed -e "s/ Simulator$//"`
45
+
device_id=$(xcrun simctl list devices available | grep "iPhone 16" | head -1 | sed -E 's/.*\(([A-Z0-9-]+)\).*/\1/')
46
+
if [ -z "$device_id" ]; then
47
+
echo "No iPhone 16 simulator found, use another simulator"
48
+
device_id=$(xcrun simctl list devices available | grep "iPhone" | head -1 | sed -E 's/.*\(([A-Z0-9-]+)\).*/\1/')
49
+
fi
50
+
echo "Use simulator with ID: $device_id"
43
51
if [ $scheme = default ]; then scheme=$(cat default); fi
44
52
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
0 commit comments