Skip to content

Commit

Permalink
Merge pull request #731 from reflex-frp/ts@fix-simulator-runtime-choice
Browse files Browse the repository at this point in the history
Choose iOS simulator runtime based on supported devices
  • Loading branch information
Ericson2314 authored Jul 12, 2021
2 parents 6c26364 + 2b54fa3 commit 904eea8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/run-in-ios-sim
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ if [ "$#" = 2 ]; then
bundleIdentifier="$2"
fi

runtime="$(xcrun simctl list runtimes -j | jq -r '.runtimes[].identifier' | head -n1)"
# Choose the first runtime which allows simulation of an iPhone 8
runtime="$(xcrun simctl list devices -j | jq -r '.devices | to_entries[] | (.key as $k | .value[] | if .isAvailable and .name == "iPhone 8" then $k else empty end)' | sort | head -n1)"
echo "Using runtime $runtime"
echo "Creating device $name"
uuid="$(xcrun simctl create "$name" com.apple.CoreSimulator.SimDeviceType.iPhone-8 "$runtime")"
echo "Device UUID $uuid"

function cleanup {
if [ -n "$uuid" ]; then
Expand Down

0 comments on commit 904eea8

Please sign in to comment.