Skip to content

Add simulator minimize and shutdown options for iOS tests#6

Merged
maatheusgois-dd merged 2 commits into
mainfrom
maatheusgois-dd/test-simulator-lifecycle
May 29, 2026
Merged

Add simulator minimize and shutdown options for iOS tests#6
maatheusgois-dd merged 2 commits into
mainfrom
maatheusgois-dd/test-simulator-lifecycle

Conversation

@maatheusgois-dd

Copy link
Copy Markdown
Contributor

Summary

Adds optional simulator lifecycle controls to bazel_ios_test and bazel_ios_test_coverage so Bazel test runs can minimize Simulator.app while executing and clean up ephemeral BAZEL_TEST_* simulators when finished.

  • minimizeSimulator polls every 2s and minimizes Simulator.app windows during the run
  • shutdownSimulatorAfterTest shuts down simulators booted for the test, deletes BAZEL_TEST_* devices, and quits Simulator.app when nothing remains booted
  • Pre-booted non-BAZEL_TEST simulators are left alone

Scope

  • MCP server/tools
  • CLI commands or parsers
  • Bazel build/test/discovery
  • Simulator workflows
  • Physical device workflows
  • UI automation, screenshots, video, logs, or deep links
  • LLDB debugging
  • macOS, tvOS, watchOS, or visionOS workflows
  • Swift Package Manager
  • Daemon, session defaults, config, doctor, or setup
  • Project scaffolding
  • Docs, examples, or agent skills
  • CI, release, packaging, or dependencies

Validation

  • npm run lint
  • npm run typecheck
  • npm test
  • npm run build
  • npx vitest --run --coverage
  • Manual MCP validation with Cursor or another MCP client
  • Manual CLI validation with xcodebazelmcp ...
  • Bazel workspace validation against a real Apple target
  • Simulator validation
  • Physical device validation

Compatibility

  • Adds, removes, or renames MCP tools
  • Changes CLI flags, command output, exit codes, or streaming behavior
  • Changes config files, environment variables, defaults, or profiles
  • Changes generated project scaffolding
  • Changes package contents, dependencies, Node support, or release behavior
  • Requires updates to docs, README, manifests, schemas, or skills
  • No compatibility impact

Notes For Reviewers

CLI usage:

xcodebazelmcp test //modules/API:APITests --minimize-simulator --shutdown-simulator --stream
xcodebazelmcp coverage //modules/API:APITests --shutdown-simulator

MCP args on bazel_ios_test / bazel_ios_test_coverage:

{
  "target": "//modules/API:APITests",
  "minimizeSimulator": true,
  "shutdownSimulatorAfterTest": true
}

New files: src/core/test-simulator.ts (hooks + cleanup logic), unit tests in src/core/test-simulator.test.ts.

Made with Cursor

Let bazel_ios_test and coverage runs keep Simulator.app out of the way and clean up BAZEL_TEST simulators when finished.

Co-authored-by: Cursor <cursoragent@cursor.com>
@maatheusgois-dd maatheusgois-dd self-assigned this May 29, 2026
Co-authored-by: Cursor <cursoragent@cursor.com>
@codecov

codecov Bot commented May 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 57 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/tools/streaming.ts 2.94% 33 Missing ⚠️
src/tools/handlers/build.ts 47.22% 19 Missing ⚠️
src/core/test-simulator.ts 96.73% 3 Missing ⚠️
src/cli/parsers.ts 0.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@maatheusgois-dd
maatheusgois-dd marked this pull request as ready for review May 29, 2026 18:06
@maatheusgois-dd
maatheusgois-dd merged commit 59ea274 into main May 29, 2026
7 checks passed
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.

1 participant