awesome-ios-sim
awesome-ios-sim
简体中文 · MCP 指南 · DeepSeek Harness · 架构
面向 iOS 开发者、CI 流水线和 AI 代理的“模拟器状态即代码”。
awesome-ios-sim 将 iOS 模拟器配置转化为可版本化的配置文件,支持捕获、差异比较、规划、审查和安全应用。它同时提供确定性的 CLI 和 MCP stdio 服务器。也可作为 dsh-plugin 包安装到 DeepSeek Harness。
项目状态:alpha。 状态模式为
v1alpha1。在应用生成的计划前请进行审查,尤其是包含erase或应用删除操作的计划。
为什么存在
模拟器自动化通常分散在 shell 脚本、未记录的默认值和手动设置中。这使得测试环境难以复现,并给 AI 代理提供了一个不安全、无类型的 shell 接口。
本项目引入了一个工作流:
profile + current snapshot -> diff -> deterministic plan -> explicit confirmation -> audited apply声明式: 将模拟器配置文件与测试和应用代码一起提交。
可审查: 在变更前检查精确的有序操作计划。
代理安全: MCP 工具使用 JSON Schema,
simulator_apply默认进行空运行。能力感知: 精确、尽力而为和不支持的状态会被明确报告。
仅限公共 API: 变更通过 Apple 的
xcrun simctl进行,不使用私有 CoreSimulator 框架。本地优先: 无需守护进程、云账户、遥测或 API 密钥。
Related MCP server: Shotter
架构
flowchart LR
P[State profile] --> E[Pure Swift state engine]
S[Live or saved snapshot] --> E
E --> D[Diff]
E --> PL[Ordered plan]
PL --> C{Explicit confirm?}
C -- No --> DR[Dry-run report]
C -- Yes --> X[Typed simctl driver]
X --> J[Execution receipts]
CLI[CLI] --> E
MCP[MCP stdio server] --> E状态引擎没有 Xcode 依赖,并使用测试夹具进行测试。只有 SimctlDriver 触及主机进程边界。CLI 和 MCP 服务器共享相同的规划器、验证和应用门控。
要求
macOS 13 或更高版本。
Swift 6。
完整的 Xcode(含 iOS 模拟器运行时)用于实时清单、快照或应用操作。
xcode-select已配置为预期的 Xcode 安装。
仅命令行工具可以构建包,但它们不提供 CoreSimulator 或 simctl。
安装
git clone https://github.com/qubyyang/awesome-ios-sim.git
cd awesome-ios-sim
swift build -c release可执行文件生成在:
.build/release/ios-sim-state
.build/release/ios-sim-state-mcpHomebrew 分发和签名发布工件计划在模式稳定后提供。
快速开始
列出可用的模拟器:
swift run ios-sim-state inventory捕获一个模拟器:
swift run ios-sim-state snapshot --device <UDID> > simulator.snapshot.json从附带的示例生成离线计划:
swift run ios-sim-state plan \
--profile Examples/ui-tests.profile.json \
--snapshot Examples/ui-tests.snapshot.json > simulator.plan.json预览应用行为而不进行变更(默认):
swift run ios-sim-state apply --plan simulator.plan.json应用已审查的计划并保留执行日志:
swift run ios-sim-state apply \
--plan simulator.plan.json \
--confirm \
--journal simulator.report.jsonapply 在第一个失败的操作处停止。每个收据包含执行的参数数组、退出码、stdout、stderr 和时间戳。
状态配置文件
配置文件是 JSON 文档,根据 schemas/v1alpha1/simulator-state.schema.json 进行验证。具有安全默认值的字段可以省略。
{
"apiVersion": "awesome-ios-sim/v1alpha1",
"kind": "SimulatorState",
"metadata": { "name": "ui-tests" },
"target": {
"name": "iPhone 17 Pro",
"runtime": "com.apple.CoreSimulator.SimRuntime.iOS-27-0"
},
"spec": {
"power": "shutdown",
"applications": [
{
"bundleIdentifier": "com.example.app",
"sourcePath": "/absolute/path/to/Example.app",
"running": true,
"launchArguments": ["--uitesting"]
}
],
"preferences": [
{
"domain": "com.example.app",
"key": "hasSeenOnboarding",
"value": false
}
],
"statusBar": { "time": "09:41", "batteryLevel": 100 }
}
}power: "unchanged" 在临时工作后恢复原始电源状态。当计划擦除时,已启动的设备会先关闭。启动操作会等待 simctl bootstatus -b 后再进行依赖工作。
CLI
命令 | 变更 | 目的 |
| 否 | 以稳定 JSON 格式列出运行时和模拟器。 |
| 否 | 捕获受管状态和能力元数据。 |
| 否 | 显示期望/当前差异。 |
| 否 | 生成有序操作计划。 |
| 否 | 返回空运行报告。 |
| 是 | 串行执行已审查的计划。 |
所有面向机器的输出均为 JSON。使用 --compact 获得单行输出。
面向 AI 代理的 MCP
构建 MCP 可执行文件,并将任何支持 stdio 的 MCP 客户端指向其绝对路径:
{
"mcpServers": {
"awesome-ios-sim": {
"command": "/absolute/path/awesome-ios-sim/.build/release/ios-sim-state-mcp"
}
}
}服务器暴露五个工具:
工具 | 行为 |
| 读取模拟器清单。 |
| 捕获一个模拟器。 |
| 将配置文件与已保存或实时状态进行比较。 |
| 生成类型化、有序的计划。 |
| 默认空运行;仅当 |
stdio 服务器实现了 MCP 2026-07-28 无状态请求模型,包括 server/discover、每个请求的 _meta、可缓存的工具列表、resultType 和 JSON Schema 2020-12。它也接受 2025-11-25、2025-06-18 和 2024-11-05 工具客户端使用的旧版初始化握手。有关线缆示例和确切支持子集,请参阅 MCP 指南。
DeepSeek Harness 插件
将仓库安装为 DSH 包并启动 Web 配置文件:
dsh plugin --profile web add github:qubyyang/awesome-ios-sim
dsh webHarness 桥接现有的 MCP 服务器,并暴露命名空间工具,如 mcp__ios_sim__simulator_inventory 和 mcp__ios_sim__simulator_plan。该适配器目前针对 @deepseek-ai/dsh 0.1.0-rc.7 进行了测试。在可复现环境中请固定标签或提交,因为 Harness 仍处于开发者预览阶段。
有关配置、开发、工具名称、卸载步骤和主机进程安全边界,请参阅 DeepSeek Harness 指南。
状态覆盖范围
状态 | 读取 | 写入 | 支持 |
电源 | 是 | 是 | 精确 |
已安装应用 | 是(当 | 是 | 尽力而为 |
应用运行状态 |
| 启动/终止 | 尽力而为 |
受管偏好键 | 无通用回读 | 标量值和标量数组 | 尽力而为 |
状态栏覆盖 | 无完整回读 | 是,依赖运行时 | 尽力而为 |
擦除 | 不适用 | 是,显式破坏性操作 | 精确变更 |
规划器永远不会将尽力而为的数据静默升级为精确状态。缺失的回读会产生能力元数据、重复的幂等写入或警告,而不是虚假的收敛声明。
安全模型
不调用 shell;可执行文件和参数分开传递。
diff、plan和默认的apply不能变更模拟器。CLI apply 需要
--confirm;MCP apply 需要布尔值confirm: true。操作串行执行,并在第一个失败处停止。
已启动的模拟器在擦除前会关闭。
临时启动会恢复请求的或原始的最终电源状态。
工具模式禁止未知的顶级参数。
不加载私有框架、不删除孤立目录、不执行文件系统清理。
将计划文件视为可执行意图。在确认前,请审查目标 UDID、应用路径、擦除操作和偏好域的变化。
为什么选择 Swift
模拟器工作主要受 Xcode 和 CoreSimulator 进程延迟影响,而非语言级别的 CPU 时间。Swift 提供原生 macOS 分发、强大的 Codable 模型,并且与 iOS 工具链直接对齐,无需添加运行时。Rust 对于可移植、CPU 密集型的索引器来说是一个强有力的选择,但它不会显著加速 simctl boot、安装或擦除。该包将纯状态引擎和进程边界分开,以便在性能分析证明有必要时,稍后引入专门的辅助工具。
开发
swift build
swift test
npm ci
npm test
npm run pack:check
swift run ios-sim-state plan \
--profile Examples/ui-tests.profile.json \
--snapshot Examples/ui-tests.snapshot.json请参阅 CONTRIBUTING.md、SECURITY.md 和 架构说明。请不要添加私有的 CoreSimulator API。
路线图
稳定配置文件模式并发布带标签的二进制文件。
添加 Homebrew 分发和签名的通用工件。
添加可重用的配置文件层和预设。
在不使用私有框架的情况下扩展能力感知设置。
在相同状态引擎之上构建原生 SwiftUI 配套应用。
许可证
MIT。请参阅 LICENSE。
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityAmaintenanceEnables interaction with iOS simulators by providing tools to inspect UI elements, control UI interactions, and manage simulators through natural language commands.179,7002,136MIT
- Alicense-qualityDmaintenanceEnables AI assistants to automate iOS Simulator interactions including device management, UI element interaction (tap, swipe, type), screenshot capture, and execution of YAML-defined navigation workflows.2MIT
- Alicense-qualityFmaintenanceAn MCP server that provides comprehensive tools for managing iOS simulators, including device control, app lifecycle management, and UI automation. It enables developers to boot devices, install apps, capture screenshots, and simulate user interactions through natural language commands.3MIT
- Flicense-qualityDmaintenanceEnables AI to control iOS simulators through the MCP protocol. Supports device management, UI automation, and network interception including screenshot capture, text input, and HTTP request mocking.
Related MCP Connectors
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
Control plane for autonomous software labor. Agents claim objectives over MCP with audit trail.
OCR, transcription, file extraction, and image generation for AI agents via MCP.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/qubyyang/awesome-ios-sim'
If you have feedback or need assistance with the MCP directory API, please join our Discord server