#!/bin/sh set -eu case "${1:-}" in off) xcrun simctl runtime delete all xcrun simctl delete all ;; on) shift if [ $# -eq 0 ]; then set -- $(printf '%s\n' iOS visionOS watchOS tvOS | fzf --multi --prompt 'download (tab to pick several): ') fi [ $# -gt 0 ] || exit 1 for platform in "$@"; do xcodebuild -downloadPlatform "$platform" done ;; '' | status) xcrun simctl runtime list ;; *) echo 'usage: xcode-sims [status | off | on [iOS|visionOS|watchOS|tvOS ...]]' >&2 exit 1 ;; esac