Integrations
Captures screenshots from iOS Simulator devices and saves them to a specified directory with options for output filename, directory, image resizing, and selecting specific simulator devices.
Runs on macOS to capture iOS Simulator screenshots, requiring macOS as the underlying operating system to access the iOS Simulator environment.
Leverages Xcode Command Line Tools to interact with iOS Simulator devices and capture screenshots through the xcrun simctl command.
MCP iOS 模拟器截图
使用模型上下文协议 (MCP) 从 iOS 模拟器捕获屏幕截图的服务器。
概述
本项目实现了一个MCP协议服务器,可以抓取iOS模拟器的当前屏幕,并保存到指定的目录。
设置
- 安装:
Copy
- MCP 客户端配置:
将服务器信息添加到您的 MCP 客户端配置文件中,如下所示:
Copy
环境变量
该服务器不使用环境变量。
命令行参数
该服务器不使用命令行参数。
高级配置
MCP 客户端安装方法配置
全局安装时
Copy
本地安装时
Copy
从存储库克隆时
Copy
使用 npx 时
Copy
使用 Docker 时
Copy
故障排除
- 如果您无法截取屏幕截图:
- 检查 iOS 模拟器是否正在运行
- 检查是否安装了 Xcode 命令行工具
- 检查是否可以直接执行
xcrun simctl io booted screenshot
命令
- 如果发生权限错误:
- 检查您是否具有输出目录的写入权限
项目结构
Copy
工具
获取ios模拟器截图
从 iOS 模拟器捕获屏幕截图并将其保存到指定目录。
参数
参数名称 | 类型 | 描述 | 默认值 |
---|---|---|---|
输出文件名 | 细绳 | 输出文件名 | 模拟器_[时间戳].png |
输出目录 | 细绳 | 输出目录 | .截图 |
调整大小 | 布尔值 | 是否调整图像大小 | 真的 |
最大宽度 | 整数 | 调整大小的最大宽度(像素) | 640 |
设备 ID | 细绳 | 指定模拟器设备(例如iPhone15,2 ) | 已启动设备( booted ) |
输出格式
成功时:
Copy
出现错误时:
Copy
要求
- Node.js 16.0.0 或更高版本
- macOS(需要 iOS 模拟器)
- Xcode 命令行工具
技术堆栈
- TypeScript
- Node.js
- MCP SDK(@modelcontextprotocol/sdk)
执照
麻省理工学院
其他语言
You must be authenticated.
使用模型上下文协议 (MCP) 从 iOS 模拟器捕获屏幕截图并将其保存到指定目录的服务器。
- Overview
- Setup
- Environment Variables
- Command Line Arguments
- Advanced Configuration
- Troubleshooting
- Project Structure
- Tools
- Requirements
- Technology Stack
- License
- Other Languages