feat: add ensure-simulator command for scoped iOS device sets#179
Merged
Conversation
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>
|
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #169
ensure-simulatorcommand that creates or reuses an iOS simulator inside a scoped device setsrc/platforms/ios/ensure-simulator.tsmodule encapsulates the simctl create/list logic--runtime,--boot, and--reuse-existingflags (all command-specific)--device <name>and--ios-simulator-device-set <path>ensure-simulatorfrom session/lease admission checks (same asdevices)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 \ --jsonJSON 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" --jsoncreates a new simulator if none existscreated: false(reuse)--bootflag boots the simulator after creation/reuse--ios-simulator-device-set <path>scopes the operation to the given device set--deviceflag returns a clearINVALID_ARGSerrorCOMMAND_FAILEDerror with a helpful hintagent-device help ensure-simulatorshows correct usage🤖 Generated with Claude Code