Free command line tool
Drive the iOS Simulator from the command line
cosmokit brings the simulator actions from the CosmoKit app to your Makefiles, git hooks and CI jobs. Free, open source, and it works whether or not you use the app.
brew install maththedev42/tap/cosmokitRequires macOS 13+ and Xcode's command line tools. Source on GitHub.
Commands
| cosmokit list | List available simulators |
| cosmokit boot [name|udid] | Boot a simulator |
| cosmokit shutdown [name|udid] | Shut a simulator down |
| cosmokit capture [name|udid] | Screenshot to a file |
| cosmokit record [name|udid] | Record video until Ctrl-C |
| cosmokit location <lat> <lon> | Set the simulator's GPS position |
| cosmokit open <url> | Open a deep link |
| cosmokit erase [name|udid] | Erase a simulator to a fresh install |
Device arguments accept a UDID, an exact name or a partial name. Omit them to use the booted simulator. --output sets the directory for capture and record.
What people use it for
Screenshots in CI
Capture every booted simulator into your repo as part of a build, so a broken layout shows up in the pull request rather than in review.
cosmokit capture --output ./screenshotsDeterministic location tests
Put the simulator somewhere specific before the suite runs, instead of relying on whatever the last manual test left behind.
cosmokit location -22.9068 -43.1729Deep links in a git hook
Exercise a deep link on every commit so a malformed route is caught before it reaches anyone else.
cosmokit open "myapp://item/42"A clean device every run
Erase and boot from a known state so a passing run means the same thing today as it did last week.
cosmokit erase "iPhone 16" && cosmokit boot "iPhone 16"Good to know
- Free and open source under the MIT license
- Universal binary, Apple silicon and Intel
- No account, no telemetry, no CosmoKit Pro required
- Shells out to xcrun simctl, so it works with the Xcode you already have
- Exits non-zero on failure, so it is safe under set -e
- Does not require the CosmoKit app to be installed
The app picks up where the CLI stops
The CLI covers what plain simctl can do. The CosmoKit app adds the network proxy, App Store screenshot generator, device frames, saved push payloads and Dev Presets, with a free tier to start.