Skip to main content
Glama
conorluddy

XC-MCP: XCode CLI wrapper

by conorluddy

Simulator Screenshot/Video Capture

simctl-io

Capture iOS simulator screenshots or record videos with optimized sizes and semantic filenames for token-efficient AI analysis and UI testing.

Instructions

simctl-io

Capture screenshots or record videos from iOS simulators with automatic optimization.

What it does

Captures simulator screen as optimized PNG images or records video with configurable codecs. Screenshots are automatically resized to tile-aligned dimensions for token efficiency and support semantic naming for AI agent reasoning.

Parameters

  • udid (string, optional): Simulator UDID (auto-detects booted device if omitted)

  • operation (string, required): "screenshot" or "video"

  • outputPath (string, optional): Custom file path (auto-generated if omitted)

  • codec (string, optional): Video codec - h264, hevc, or prores (default: h264)

  • size (string, optional): Screenshot size - half, full, quarter, thumb (default: half)

  • appName (string, optional): App name for semantic naming

  • screenName (string, optional): Screen/view name for semantic naming

  • state (string, optional): UI state for semantic naming

Screenshot Size Optimization

Screenshots are automatically optimized for token efficiency:

  • half (default): 256×512 pixels, 1 tile, 170 tokens (50% savings)

  • full: Native resolution, 2 tiles, 340 tokens

  • quarter: 128×256 pixels, 1 tile, 170 tokens

  • thumb: 128×128 pixels, 1 tile, 170 tokens

Semantic Naming (LLM Optimization)

Provide appName, screenName, and state to generate semantic filenames:

  • Format: {appName}_{screenName}_{state}_{date}.png

  • Example: MyApp_LoginScreen_Empty_2025-01-23.png

  • Enables AI agents to reason about screen context and track state progression

Returns

JSON response with:

  • File path and size information

  • Screenshot optimization metadata (dimensions, token count, savings)

  • Coordinate transform for mapping resized coordinates to device

  • Semantic metadata when provided

  • Guidance for viewing and using the capture

Examples

Capture optimized screenshot (default 256×512)

await simctlIoTool({
  udid: 'device-123',
  operation: 'screenshot'
})

Capture full-size screenshot

await simctlIoTool({
  udid: 'device-123',
  operation: 'screenshot',
  size: 'full'
})

Capture with semantic naming

await simctlIoTool({
  udid: 'device-123',
  operation: 'screenshot',
  appName: 'MyApp',
  screenName: 'LoginScreen',
  state: 'Empty'
})

Record video with custom codec

await simctlIoTool({
  udid: 'device-123',
  operation: 'video',
  codec: 'hevc'
})

Common Use Cases

  1. UI testing: Capture screenshots for visual regression testing

  2. Bug reporting: Record videos demonstrating issues

  3. Documentation: Create screenshots for app documentation

  4. State tracking: Use semantic naming to track UI state progression

  5. Token optimization: Use half/quarter sizes for LLM-based analysis

Coordinate Transform

When screenshots are resized (size ≠ 'full'), a coordinate transform is provided:

  • scaleX: Multiply screenshot X coordinates by this to get device coordinates

  • scaleY: Multiply screenshot Y coordinates by this to get device coordinates

  • guidance: Human-readable scaling instructions

This enables accurate element tapping even with optimized screenshots.

Important Notes

  • Auto-detection: If udid is omitted, automatically uses the booted device

  • Temp files: Screenshots saved to /tmp unless custom path specified

  • Video recording: Press Ctrl+C to stop video recording

  • Simulator must be booted: Operations require running simulator

  • File permissions: Ensure output path is writable

Error Handling

  • Simulator not booted: Indicates simulator must be booted first

  • Simulator not found: Validates simulator exists in cache

  • File path errors: Reports if output path is not writable

  • Invalid operation: Validates operation is "screenshot" or "video"

Next Steps After Capture

  1. View screenshot: open "<file-path>"

  2. Copy to clipboard: pbcopy < "<file-path>"

  3. Analyze with LLM: Use optimized size for token-efficient analysis

  4. Use coordinates: Apply transform to map screenshot coords to device

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sizeNo
udidYes
codecNo
stateNo
appNameNo
operationYes
outputPathNo
screenNameNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.1.0

TDQS

A4.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations are minimal (all false hints), so the description carries the burden. It discloses key behaviors: auto-detection of booted device, automatic resizing to tile-aligned dimensions, temp file location (/tmp), Ctrl+C to stop video recording, simulator must be booted, and coordinate transform for resized screenshots. It also explains error handling. This goes well beyond the annotations, though it doesn't explicitly state that screenshots are written to disk (implied by 'saved to /tmp') or discuss idempotency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is long but well-structured with clear sections (What it does, Parameters, Size Optimization, Semantic Naming, Returns, Examples, Use Cases, Coordinate Transform, Important Notes, Error Handling, Next Steps). It front-loads the core purpose and parameters. Some redundancy exists (e.g., size details repeated in Parameters and Size Optimization sections), but the structure makes it scannable and each section earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (8 params, 2 required, 3 enums, no output schema), the description is remarkably complete. It covers input semantics, output structure (JSON with file path, optimization metadata, coordinate transform), error handling, prerequisites (booted simulator), and post-capture steps. The examples cover all major operations. Nothing critical is missing for an agent to invoke it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It does: each parameter is listed with type, required/optional status, and meaning. It adds semantic context for size (token efficiency, pixel dimensions), codec (h264/hevc/prores), and semantic naming parameters (appName, screenName, state) with filename format examples. The description adds significant value beyond the bare schema, though it doesn't document every nuance (e.g., outputPath format).

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool captures screenshots or records videos from iOS simulators, with a specific verb ('Capture') and resource ('iOS simulators'). It distinguishes itself from sibling tools like simctl-list, simctl-boot, and the standalone 'screenshot' tool by focusing on capture with optimization and semantic naming. The title and description align well.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit when-to-use guidance through 'Common Use Cases' (UI testing, bug reporting, documentation, state tracking, token optimization) and 'Important Notes' (auto-detection, temp files, video recording, simulator must be booted). It also implicitly differentiates from siblings by focusing on capture rather than management or inspection. The 'Next Steps After Capture' section adds practical usage context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.