← 返回命令列表

Linux command

simctl 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

List all simulators

xcrun simctl list

Boot a simulator

xcrun simctl boot "[iPhone 15 Pro]"

Shutdown a simulator

xcrun simctl shutdown [device_uuid|booted]

Install an app

xcrun simctl install booted [path/to/app.app]

Launch an app

xcrun simctl launch booted [com.example.bundleid]

Take a screenshot

xcrun simctl io booted screenshot [output.png]

Send a push notification

xcrun simctl push booted [com.example.bundleid] [notification.apns]

Grant a privacy permission

xcrun simctl privacy booted grant [location] [com.example.bundleid]

说明

simctl is Apple's command-line tool for managing and interacting with iOS, watchOS, and tvOS simulators on macOS. It's accessed through xcrun simctl to ensure the correct version matching your active Xcode installation is used. The tool provides comprehensive control over simulator lifecycle (create, boot, shutdown, delete), application management (install, launch, uninstall), and testing features (push notifications, privacy permissions, screenshots, video recording). It's particularly useful for automated testing, CI/CD pipelines, and development workflows. The special identifier booted can be used to target the currently running simulator instead of specifying a UUID.

FAQ

What is the simctl command used for?

simctl is Apple's command-line tool for managing and interacting with iOS, watchOS, and tvOS simulators on macOS. It's accessed through xcrun simctl to ensure the correct version matching your active Xcode installation is used. The tool provides comprehensive control over simulator lifecycle (create, boot, shutdown, delete), application management (install, launch, uninstall), and testing features (push notifications, privacy permissions, screenshots, video recording). It's particularly useful for automated testing, CI/CD pipelines, and development workflows. The special identifier booted can be used to target the currently running simulator instead of specifying a UUID.

How do I run a basic simctl example?

Run `xcrun simctl list` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

Where can I find more simctl examples?

This page includes 8 examples for simctl, plus related commands for nearby Linux tasks.