Title: build_run_device/launch_app_device: launchArgs containing leading dashes parsed by devicectl as its own flags (no '--' separator) · Issue #434 · getsentry/XcodeBuildMCP · GitHub
Open Graph Title: build_run_device/launch_app_device: launchArgs containing leading dashes parsed by devicectl as its own flags (no '--' separator) · Issue #434 · getsentry/XcodeBuildMCP
X Title: build_run_device/launch_app_device: launchArgs containing leading dashes parsed by devicectl as its own flags (no '--' separator) · Issue #434 · getsentry/XcodeBuildMCP
Description: Bug When calling build_run_device or launch_app_device with launchArgs that contain values starting with - (e.g. ["-FIRDebugEnabled"] for Firebase Analytics DebugView), the tools fail with: Failed to launch app on device: Error: Missing ...
Open Graph Description: Bug When calling build_run_device or launch_app_device with launchArgs that contain values starting with - (e.g. ["-FIRDebugEnabled"] for Firebase Analytics DebugView), the tools fail with: Failed ...
X Description: Bug When calling build_run_device or launch_app_device with launchArgs that contain values starting with - (e.g. ["-FIRDebugEnabled"] for Firebase Analytics DebugView), the tools fail wit...
Opengraph URL: https://github.com/getsentry/XcodeBuildMCP/issues/434
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"build_run_device/launch_app_device: launchArgs containing leading dashes parsed by devicectl as its own flags (no '--' separator)","articleBody":"## Bug\n\nWhen calling `build_run_device` or `launch_app_device` with `launchArgs` that contain values starting with `-` (e.g. `[\"-FIRDebugEnabled\"]` for Firebase Analytics DebugView), the tools fail with:\n\n```\nFailed to launch app on device: Error: Missing value for '-l \u003cpath\u003e'\nHelp: -l \u003cpath\u003e An optional path to write all logging otherwise passed to stdout/stderr.\nUsage: devicectl [--verbose] [--quiet] [--timeout \u003cseconds\u003e] [--json-output \u003cpath\u003e] [--log-output \u003cpath\u003e] \u003csubcommand\u003e\n```\n\nApple's `devicectl` parses the `-FIRDebugEnabled` argument as if it were one of its own flags (it sees the leading `-` and apparently lands on `-l \u003cpath\u003e` expecting a value). This means **no launchArgs that start with `-` can be passed to a running app on device**, which breaks the common case for any framework that reads `ProcessInfo.processInfo.arguments` (Firebase, AppLovin, custom debug flags, etc.).\n\n## Reproduction\n\n```jsonc\n// .mcp.json\n{\n \"mcpServers\": {\n \"xcodebuild\": {\n \"command\": \"npx\",\n \"args\": [\"-y\", \"xcodebuildmcp@latest\", \"mcp\"],\n \"env\": { \"XCODEBUILDMCP_ENABLED_WORKFLOWS\": \"simulator,device,project-discovery,session-management\" }\n }\n }\n}\n```\n\nThen via tool calls:\n\n```jsonc\n// session_set_defaults with a real device's deviceId, workspacePath, scheme, bundleId\n// build_run_device with:\n{ \"launchArgs\": [\"-FIRDebugEnabled\"], \"platform\": \"iOS\" }\n```\n\n→ Build succeeds, install succeeds, launch step fails with the devicectl `-l` error.\n\nSame failure with `launch_app_device({ launchArgs: [\"-FIRDebugEnabled\"] })`.\n\n## Expected\n\n`launchArgs` should be passed to the launched app's `ProcessInfo.processInfo.arguments` — i.e. forwarded *past* devicectl's argument parser. Apple's documented way to do that with `devicectl` is to add a literal `--` separator before the app's args:\n\n```\nxcrun devicectl device process launch \\\n --device \u003cudid\u003e \\\n --terminate-existing \\\n \u003cbundle-id\u003e \\\n -- -FIRDebugEnabled\n```\n\n## Workaround (confirmed working)\n\nDrop the MCP tool for the launch step and invoke devicectl directly via shell with the `--` separator. Build/install via the MCP works fine; only the launch step needs the workaround:\n\n```bash\nxcrun devicectl device process launch \\\n --device $DEVICE_ID \\\n --terminate-existing \\\n $BUNDLE_ID \\\n -- -FIRDebugEnabled\n```\n\n## Suggested fix\n\nIn whatever spawns `devicectl device process launch` for `launch_app_device` / `build_run_device`, insert a literal `\"--\"` between devicectl's own flags and the app's launchArgs before forwarding them.\n\n## Environment\n\n- xcodebuildmcp: latest (`npx -y xcodebuildmcp@latest mcp` resolved 2026-05-30)\n- Xcode: 26.5 (DeveloperTools/26.5-17F42)\n- Host: macOS Tahoe 26.2 (arm64)\n- Device: iPhone, iOS 26.5 (real device via USB tunnel)\n- Client: Claude Code with VSCode extension\n\nHappy to test a fix against a real device if it helps.","author":{"url":"https://github.com/phdlance1","@type":"Person","name":"phdlance1"},"datePublished":"2026-05-31T01:23:51.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/434/XcodeBuildMCP/issues/434"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:f012a3a1-4e6b-9dea-f53b-f3c4c8e6f276 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A578:38BCC1:1E343:29A45:6A4D0041 |
| html-safe-nonce | d43d7028a89d1ed07e75c8af39aed08c54f80c4031adc7d8e9c11bc0f52ea494 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNTc4OjM4QkNDMToxRTM0MzoyOUE0NTo2QTREMDA0MSIsInZpc2l0b3JfaWQiOiI1MzAzMTg3MDY3ODEwNjc2ODAxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | b99c64f534a372c3ae96ebce022229a212ddd79d571e3e8bf01db0a71ba66e30 |
| hovercard-subject-tag | issue:4556224320 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/XcodeBuildMCP/434/issue_layout |
| twitter:image | https://opengraph.githubassets.com/50b364b673360d2e1853ed6937f0a120ebfdd5327f64e00bfdec456100d9d982/getsentry/XcodeBuildMCP/issues/434 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/50b364b673360d2e1853ed6937f0a120ebfdd5327f64e00bfdec456100d9d982/getsentry/XcodeBuildMCP/issues/434 |
| og:image:alt | Bug When calling build_run_device or launch_app_device with launchArgs that contain values starting with - (e.g. ["-FIRDebugEnabled"] for Firebase Analytics DebugView), the tools fail with: Failed ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | phdlance1 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 31e4db13a9e20081f2fac78f441659a6576e582bbb15e153f9c7fb6473aa29f5 |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/XcodeBuildMCP git https://github.com/getsentry/XcodeBuildMCP.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 945551361 |
| octolytics-dimension-repository_nwo | getsentry/XcodeBuildMCP |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 945551361 |
| octolytics-dimension-repository_network_root_nwo | getsentry/XcodeBuildMCP |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | fb70bd3c4b2bec429781b65419e912c66e2d5581 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width