Skip to content

Instantly share code, notes, and snippets.

@paulz
Created April 5, 2023 04:18
Show Gist options
  • Save paulz/cdbf346461d360caa98d2b0d807b728c to your computer and use it in GitHub Desktop.
Save paulz/cdbf346461d360caa98d2b0d807b728c to your computer and use it in GitHub Desktop.
Script to create or re-create simulators on self hosted runner
#!/bin/zsh
scriptDir=${0:a:h}
deleteAndCreate() {
xcrun simctl delete "$1"
xcrun simctl create "$1" com.apple.CoreSimulator.SimDeviceType.iPad-mini-6th-generation 2> /dev/null
}
createSimulatorWithContact() {
deleteAndCreate "ipad-runner$1"
xcrun simctl boot "ipad-runner$1"
xcrun simctl addmedia "ipad-runner$1" "$scriptDir/../UITests/contact-with-links.vcf"
}
for i in {1..7}
do
createSimulatorWithContact $i &
done
deleteAndCreate "ipad-with-external-display" &
wait
echo DONE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment