Skip to content

Commit 06daa85

Browse files
committed
using first device instead of getting latest runtime + device
1 parent 658b0b6 commit 06daa85

1 file changed

Lines changed: 5 additions & 9 deletions

File tree

.github/workflows/ios.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,18 @@ jobs:
2828
# Clean up whitespace
2929
file_to_build=`echo $file_to_build | awk '{$1=$1;print}'`
3030
31-
# Find latest available iOS runtime identifier
32-
latest_runtime_id=$(xcrun simctl list runtimes | grep -E "iOS [0-9]+\.[0-9]*" | grep -v unavailable | sort -Vr | head -n 1 | sed -E 's/.*- (.*)$/\1/')
31+
# Find first available simulator
32+
device_name=$(xcrun simctl list devices available | grep "iPhone" | head -n 1 | sed -E 's/^[[:space:]]*(.+) \(.+\) \(.+\)$/\1/')
3333
34-
# Find a compatible simulator device name for that runtime
35-
device_name=$(xcrun simctl list devices available | grep "$latest_runtime_id" | head -n 1 | sed -E 's/^ (.+) \(.+\) \(.+\)$/\1/')
36-
37-
if [ -z "$latest_runtime_id" ] || [ -z "$device_name" ]; then
38-
echo "❌ Failed to find a valid iOS runtime or device."
34+
if [ -z "$device_name" ]; then
35+
echo "❌ Failed to find a valid iOS device."
3936
exit 1
4037
fi
4138
42-
echo "🛠 Using runtime: $latest_runtime_id"
4339
echo "📱 Using device: $device_name"
4440
4541
# Build and run the tests
4642
xcodebuild test \
4743
-scheme "$scheme" \
4844
-"$filetype_parameter" "$file_to_build" \
49-
-destination "platform=iOS Simulator,OS=$latest_runtime_id,name=$device_name"
45+
-destination "platform=iOS Simulator,name=$device_name"

0 commit comments

Comments
 (0)