Search code examples
xcodemacosexpoios-simulatorxcode13

How to run multiple simulators by COMMAND - Xcode 13 with no "instruments" anymore


These commands were used to run multiple simulators, install Expo, and run the app. This was working fine before Xcode 13, and after installing Xcode 13, it doesn't load simulators anymore as it can not find "instruments" anymore.

Any idea?

#!/bin/bash
declare -a simulators=("0FAE2F92-9EF7-4C4A-8F9D-097A056F8CC0" "BFCDD662-E4DE-4C08-9DF6-CAACA7C00CEC" "1A6959A0-C10F-474B-96C5-7E8955FBDD80")

for i in "${simulators[@]}"
do
    xcrun instruments -w $i
    xcrun simctl install $i ~/.expo/ios-simulator-app-cache/Exponent-2.19.6.tar.app
    xcrun simctl openurl $i exp://127.0.0.1:19000      
done

Solution

  • Those who need to run multiple simulators with one command, please follow this instruction. Since "instruments" is not available on Xcode 13 anymore, you need an equivalent command to boot simulators.

    Replace the device IDs with your device IDs xcrun simctl list. Also, replace the Expo version with what you have on your machine.

    #!/bin/zsh
    declare -a simulators=("27D6B718-8348-4C4D-ADFC-6506C2A88EED" "531A59B8-6197-4620-904B-E55308D1EE96" "C08532FE-3CE4-4BB7-A04C-795F2FA7EFE1")
    echo "STARTED"
    open -a Simulator
    wait_time=1
    for i in $simulators[@]
    do
        echo "Boot $i"
        xcrun simctl boot $i
        sleep $wait_time
        echo "Install Expo $i"
        xcrun simctl install $i ~/.expo/ios-simulator-app-cache/Exponent-2.19.6.tar.app
        sleep $wait_time
        echo "Lauch Expo $i"
        xcrun simctl openurl $i exp://127.0.0.1:19000
        sleep $wait_time
    done
    echo "FINISHED"