Skip to content

feat: add ensure-simulator command for scoped iOS device sets#179

Merged
thymikee merged 2 commits into
mainfrom
claude/upbeat-williamson
Mar 3, 2026
Merged

feat: add ensure-simulator command for scoped iOS device sets#179
thymikee merged 2 commits into
mainfrom
claude/upbeat-williamson

Conversation

@thymikee
Copy link
Copy Markdown
Member

@thymikee thymikee commented Mar 3, 2026

Summary

Closes #169

  • Adds a new first-class ensure-simulator command that creates or reuses an iOS simulator inside a scoped device set
  • New src/platforms/ios/ensure-simulator.ts module encapsulates the simctl create/list logic
  • Adds --runtime, --boot, and --reuse-existing flags (all command-specific)
  • Uses existing global flags: --device <name> and --ios-simulator-device-set <path>
  • Exempts ensure-simulator from session/lease admission checks (same as devices)

Example usage:

agent-device ensure-simulator \
  --device "iPhone 16" \
  --runtime com.apple.CoreSimulator.SimRuntime.iOS-18-4 \
  --ios-simulator-device-set /path/to/device-set \
  --boot \
  --json

JSON output:

{
  "success": true,
  "data": {
    "udid": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
    "device": "iPhone 16",
    "runtime": "com.apple.CoreSimulator.SimRuntime.iOS-18-4",
    "ios_simulator_device_set": "/path/to/device-set",
    "created": false,
    "booted": true
  }
}

Test plan

  • agent-device ensure-simulator --device "iPhone 16" --json creates a new simulator if none exists
  • Running the same command again returns created: false (reuse)
  • --boot flag boots the simulator after creation/reuse
  • --ios-simulator-device-set <path> scopes the operation to the given device set
  • Missing --device flag returns a clear INVALID_ARGS error
  • Invalid device name or runtime returns a COMMAND_FAILED error with a helpful hint
  • agent-device help ensure-simulator shows correct usage
  • All existing tests pass

🤖 Generated with Claude Code

Adds a new first-class `ensure-simulator` command that ensures an iOS
simulator exists (and optionally boots it) inside a scoped device set,
without requiring custom simctl scripting outside agent-device.

Usage:
  agent-device ensure-simulator --device "iPhone 16" [--runtime <id>] [--boot] [--ios-simulator-device-set <path>]

JSON output includes udid, device, runtime, ios_simulator_device_set,
and whether the simulator was created vs reused.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 3, 2026

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://callstackincubator.github.io/agent-device/pr-preview/pr-179/

Built to branch gh-pages at 2026-03-03 18:05 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@thymikee thymikee merged commit bb06baf into main Mar 3, 2026
5 of 6 checks passed
@thymikee thymikee deleted the claude/upbeat-williamson branch March 3, 2026 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add ensure-simulator command for iOS scoped device sets

1 participant