Skip to content

feat: add --shutdown option to close command for iOS simulator teardown#176

Merged
thymikee merged 3 commits intomainfrom
claude/wizardly-lamarr
Mar 3, 2026
Merged

feat: add --shutdown option to close command for iOS simulator teardown#176
thymikee merged 3 commits intomainfrom
claude/wizardly-lamarr

Conversation

@thymikee
Copy link
Copy Markdown
Contributor

@thymikee thymikee commented Mar 3, 2026

Closes #172

Summary

  • Adds --shutdown flag to the close command
  • When set, after ending the session the associated iOS simulator is shut down via xcrun simctl shutdown
  • Shutdown result (success, exitCode, stdout, stderr) is included in the JSON response data.shutdown
  • Flag is silently ignored for non-simulator targets (physical iOS devices, Android)

Changes

  • command-schema.ts: adds shutdown?: boolean to CliFlags, registers --shutdown flag, adds it to close's allowedFlags
  • simulator.ts: adds shutdownSimulator(device) — wraps xcrun simctl shutdown <udid> with allowFailure: true
  • session.ts: invokes shutdownSimulator after session deletion when flag is set and device is a simulator; injectable override for tests
  • sessions.md / session-management.md: documents the new flag with usage example and CI/multi-tenant note
  • Tests: 3 session handler unit tests (simulator shutdown, physical device skip, no-flag skip) + 2 CLI-level tests (--shutdown accepted, --shutdown --json no-daemon no-op)

Test plan

  • close --shutdown on iOS simulator ends session and shuts down the simulator; data.shutdown.success === true
  • close --shutdown on iOS physical device ends session normally, no shutdown called
  • close (no flag) on iOS simulator ends session without calling shutdown
  • close --shutdown --json no-daemon no-op returns same response as without --shutdown
  • All existing tests pass

🤖 Generated with Claude Code

thymikee and others added 3 commits March 3, 2026 19:44
…wn (#172)

When --shutdown is passed, close ends the session then runs xcrun simctl
shutdown on the associated simulator. Shutdown result (success, exitCode,
stdout, stderr) is included in the JSON response data.

The option is silently ignored for non-simulator targets (physical iOS
devices, Android). A shutdownSimulator override is injected into
handleSessionCommands for testability.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@thymikee thymikee force-pushed the claude/wizardly-lamarr branch from c2a1a2e to 4033408 Compare March 3, 2026 18:45
@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-176/

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

@thymikee thymikee merged commit 22deb54 into main Mar 3, 2026
6 checks passed
@thymikee thymikee deleted the claude/wizardly-lamarr branch March 3, 2026 19:00
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 close --shutdown option to terminate associated iOS simulator

1 participant