1XCODE_SIMULATORS=$(xcrun simctl list devices | grep "iPhone" | wc -l) 2if [ $XCODE_SIMULATORS == '0' ]; then 3 SIMULATOR_DEVICE=$(xcrun simctl create 'iPhone 12' 'iPhone 12' 'iOS15.0') 4 echo "Booting device $SIMULATOR_DEVICE" 5 xcrun simctl boot $SIMULATOR_DEVICE 6else 7 echo "Already have $XCODE_SIMULATORS simulators set up." 8fi 9