feat(simulator-management): add tools to toggle iOS Simulator software and hardware keyboard#347
Open
yjmeqt wants to merge 7 commits intogetsentry:mainfrom
Open
feat(simulator-management): add tools to toggle iOS Simulator software and hardware keyboard#347yjmeqt wants to merge 7 commits intogetsentry:mainfrom
yjmeqt wants to merge 7 commits intogetsentry:mainfrom
Conversation
Resolves a simulator UDID to its device name, verifies the simulator is booted, focuses its Simulator.app window via AppleScript, and sends a Cmd+K or Cmd+Shift+K keystroke. Consumed by the keyboard toggle tools added in subsequent commits. Refs getsentry#346
Exposes Simulator > I/O > Keyboard > Toggle Software Keyboard (Cmd+K) as an MCP tool. Delegates to the shared keyboard shortcut helper. Refs getsentry#346
Exposes Simulator > I/O > Keyboard > Connect Hardware Keyboard (Cmd+Shift+K) as an MCP tool. Disconnecting makes the on-screen keyboard appear for tap-based input during UI automation. Refs getsentry#346
Regenerate TOOLS.md and TOOLS-CLI.md, register the new tools in the simulator-management workflow, and add CHANGELOG entries for toggle_software_keyboard and toggle_connect_hardware_keyboard. Refs getsentry#346
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ca39643. Configure here.
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
Adds two MCP tools exposing the iOS Simulator's keyboard menu items, which have no direct
xcrun simctlequivalent and were unreachable through the server.toggle_software_keyboard—Simulator → I/O → Keyboard → Toggle Software Keyboard(Cmd+K)toggle_connect_hardware_keyboard—Simulator → I/O → Keyboard → Connect Hardware Keyboard(Cmd+Shift+K)Both delegate to a shared helper
_keyboard_shortcut.tsthat:simulatorIdto its device name viaxcrun simctl list devices --jsonand verifies the simulator is booted.open -a Simulator.AXRaiseon the window whose title contains the device name — errors out if no matching window is found (no silent fallthrough to the frontmost window).osascriptinvocation.Resolves #346.
Implementation notes
defaults write ConnectHardwareKeyboard: thedefaultsroute is a persistent global preference that only takes effect on simulator launch; it cannot toggle a running simulator and applies to all simulators simultaneously. The AppleScript approach mirrors the manual user action exactly, takes effect immediately, and leaves no persistent state — which matches what UI-automation consumers expect. Happy to revisit if maintainers preferdefaults.osascript … tell process "Simulator" to keystroke …call to succeed. This is already a prerequisite for other UI automation tools in this repo; surfaced explicitly in both tool descriptions.manifests/workflows/simulator-management.yamlso they appear in the Simulator Management workflow group inTOOLS.md/TOOLS-CLI.md.TOOLS.mdandTOOLS-CLI.mdregenerated vianpm run docs:update;CHANGELOG.mdgains a new## [Unreleased]section with both entries linked to [Feature]: Add tools to toggle iOS Simulator software keyboard and hardware keyboard connection #346.Test plan
npm run typecheck— passesnpm run lint— passesnpm run format:check— passesnpm run docs:check— passesnpm test— 144 files / 1457 tests pass (+3 files / +17 tests over baseline); covers success path, not-found, not-booted, open-app-failed, no-window-found, osascript-failed, and exception paths for both tools