xcodebug
v1.2.8
Published
Build, install and launch an iOS app on a physical device and read its console inside the agent session (pi / omp extension)
Maintainers
Readme
xcodebug
Overview
Drive a physical iOS device from the agent session: build/install/launch with Xcode, then read the app's console output (stdout/stderr + os_log) inside the session.
No jailbreak, no LLDB attach, no paid account. It uses the tooling Xcode itself ships with:
| What Xcode's console shows | How xcodebug gets it |
|---|---|
| print / NSLog / os_log | xcrun devicectl device process launch --console |
| os_log in the console | OS_ACTIVITY_DT_MODE=YES on that launch |
| an app you don't want to restart | idevicesyslog -p <ProcessName> (optional) |
| build + install | xcodebuild + xcrun devicectl device install app |
devicectl --console needs the app to be launched by it, so launch restarts
the app. syslog attaches to an already-running process instead.
| Client | Recommended installation | In-session entry point |
|---|---|---|
| pi/omp extension | Native package | /xcodebug |
| Claude Code | Marketplace plugin | /xcodebug:xcodebug |
| Codex | Marketplace plugin | xcodebug:xcodebug in the $ picker |
Follow the installation steps for your client. Claude Code and Codex fetch the
plugin from GitHub through Marketplace. Put Bun on the client's
PATH to run the bundled MCP server. No separate checkout or npm install is
required for either Marketplace installation.
Bun fetches uncached runtime dependencies from its configured package registry
on first use.
See the practical guide for examples or the reference
for configuration, actions, and log retention.
Requirements
| Need | Why |
|---|---|
| macOS + Xcode (command-line tools) | only Xcode/device actions: xcodebuild, xcrun devicectl |
| idevicesyslog from libimobiledevice | optional; only syslog and the dual-channel safety net |
| Git | Git-backed Marketplace downloads and project change detection |
| CocoaPods | optional; only projects with a Podfile |
| Bun | standalone CLI and MCP server |
| GitHub CLI (gh) | only for feedback; authenticate with gh auth login --hostname github.com |
The agent tool's action=doctor reports the Xcode toolchain, capture tools, active
configuration, log directory, loaded package version, source path and source digest.
Shared configurations can stay installed on Linux/Windows. Xcode/device actions
return unsupported_platform before project discovery; doctor, feedback and
local controls remain available. The execution host's OS is checked, not the
client's OS. Commands require /bin/sh; Windows returns unsupported_shell.
An explicit stop still completes cleanup before rejecting its appended command.
See host availability for action coverage.
Standalone CLI
Run this in the xcodebug checkout with Bun on PATH.
npm install -g .Connect a physical iOS device over USB. In the iOS project directory, run
xcodebug in your terminal. It uses the project's configuration and target
discovery, builds the app, installs it on the selected device, and exits. Your
agent and the Xcode GUI can stay closed. Open the installed app on the device
when ready. The CLI does not launch the app or start a console capture.
Use xcodebug --scheme MyApp --device "My iPhone" to select a target explicitly.
xcodebug --help lists the available options. The command prints the build and
install results and saves build logs under ~/.xcodebug/cli/logs/xcodebug/.
Set XCODEBUG_AGENT_DIR to use <directory>/logs/xcodebug/ instead.
Build and pod-install logs use owner-only file permissions. Preparing a run
also restricts an existing log directory to its owner. The final logs/xcodebug
directory must be owned by the current user and must be a directory without a symbolic link.
pi/omp extension
pi and omp load index.ts in-process. They do not need an MCP registration
or the shared skill.
| Client | Install command |
|---|---|
| pi | pi install npm:xcodebug |
| omp | omp plugin install npm:xcodebug |
Open a new project session and run /xcodebug doctor.
Pushing logs into the conversation
In native pi/omp, push controls whether new lines are mirrored into the session.
The MCP adapter accepts only off; Claude Code and Codex use logs/wait.
context(default) — new lines are queued for the next turn (does not start one).off— pull withlogs/waitonly.wake— new lines start a turn.
Native slash-command results stay in the transcript and UI. Failed commands are queued for the next user turn and do not wake the model, including malformed arguments, preflight failures, and runtime failures. A command that completes successfully starts an analysis turn so its result can be interpreted. push=wake explicitly starts a turn for a valid parsed request, including when that request later fails during preflight or runtime. Malformed arguments cannot establish push intent and always remain queued.
Each push carries at most 80 lines and reports how many were omitted from that
batch. Use match to narrow the pushed lines, for example with
xcodebug action=launch match=MySDK push=wake. To recover retained evidence
omitted by a push, query logs with the same capture ID and an earlier cursor.
A filtered query can also search retained files for lines evicted from memory.
Native pi/omp needs only the extension, not this skill or an MCP connection.
Both hosts register extensions: ["./index.ts"]; pi.skills: [] disables pi's
package skill loading. The shared skill lives under mcp/skills/, outside the
root skills/ directory that omp scans independently of manifest fields.
Native /xcodebug runs
the registered extension handler directly; it does not ask the model to select
a skill. A normal model tool call uses the registered native xcodebug tool.
If pi/omp also discovers the shared user-level skill through .agents/skills
or .claude/skills, its instructions select that native tool before MCP.
This shared-skill selection is model-driven, not a substitute for the native
command's deterministic dispatch. The extension must be installed, enabled and
loaded in the session; explicitly disabling it is not overridden.
Claude Code
Claude Code Marketplace installation
claude plugin marketplace add sublimter/xcodebug
claude plugin install xcodebug@sublimter-xcodebug --scope userOpen a new Claude session in the project and run /xcodebug:xcodebug doctor.
The plugin bundles the skill, MCP server, and live display Mod. Check /plugin
for the enabled plugin. In /mcp, confirm plugin:xcodebug:xcodebug is
connected. Verified with Claude Code 2.1.333.
Claude Code live display
The Marketplace plugin includes the live band. It needs Claude Code 2.1.323 or later in an interactive terminal. For an existing manual setup, see special installation cases.
Use and expected display
In your project session, run /xcodebug:xcodebug launch scheme=MyApp for
Marketplace, or /xcodebug launch scheme=MyApp for manual setup.
During build, install, launch, and the rebuild within restart, the Mod shows
the current phase and elapsed time below the prompt. When the operation ends,
the band above the prompt shows the latest four App log lines once available.
A confirmed capture with no App logs yet shows its status below the prompt.
Bridge reconnect diagnostics remain available through logs without opening the band.
The status and band refresh once a second between and during turns, then clear
when no operation or capture is running. When the Mod starts, it checks the current
MCP connection once and resumes polling if there is active work. A new Claude
session does not inherit an old server's captures. Read-only and cleanup
actions do not start polling unless they carry a command. Build progress shows
observed Xcode activity. Use logs or wait to give the model log evidence.
The Mod calls the read-only xcodebug_ui tool on the existing connection once
when a display starts. That in-memory read bypasses the action queue, so a
build or wait cannot block it. A tool call runs the session's PreToolUse
and PostToolUse hooks, so the reads after it come from a file instead: the
server keeps the same snapshot in ~/.xcodebug/ui/<pid>.json, names it in the
xcodebug_ui answer and removes it when it exits; one left by a server that
was killed is removed by the next server to start. Each call that starts a
display asks the server again, as does a file that is missing or stops
changing; with an older server that names no file the Mod calls the tool on
every read. After three failed reads in a row it
stops and clears the band until the next such call. Reading does not change the
active capture or log cursors, and request progress still stops when its
originating call returns. No second server is started. The Mod leaves an
existing statusLine alone;
Codex does not load this Claude-only Mod.
If the band is missing
- In
/plugin, checkxcodebug@sublimter-xcodebugfor Marketplace orxcodebug-live@skills-dirfor manual setup. Check the Errors tab if it did not load. Safe mode, disabled Mods or hooks, and managed settings can block it. - In
/mcp, checkplugin:xcodebug:xcodebugfor Marketplace orxcodebugfor manual setup. If the manual server lacksxcodebug_ui, inspect its path withclaude mcp get xcodebug; the adapter may be out of date. - Run
/xcodebug:xcodebug statusfor Marketplace or/xcodebug statusfor manual setup in that session. The band opens when there are App logs to show. - After updating the plugin, server, or Mod, restart Claude Code. Reloading
the plugin files does not restart an existing MCP server.
claude -psessions do not draw the band.
For manual setup, claude plugin disable xcodebug-live@skills-dir disables
only the band after reopening Claude Code. Disabling the Marketplace plugin
also disables its bundled skill and MCP server.
Codex
Codex Marketplace installation
codex plugin marketplace add sublimter/xcodebug
codex plugin add xcodebug@sublimter-xcodebug --jsonOpen a new project session, select xcodebug:xcodebug in the $ picker, and
ask for doctor. Confirm source: points to the installed plugin. Its MCP
server is named xcodebug_marketplace so an old manual xcodebug registration
cannot hide it. The plugin sets a 5400-second tool timeout, and its skill passes
the project directory as cwd. Direct project-scoped calls need the absolute
path of an existing directory. restart reuses the last launch directory.
If a symlink and .. make the path ambiguous, pass the resolved directory.
The live footer is optional. Verified with Codex CLI 0.172.0.
Long builds in Codex
The Marketplace server's 5400-second tool timeout covers the entire request,
including build, install, and launch. It applies independently of xcodebug's
one-hour build reminder and optional per-stage timeoutSeconds.
To raise it, run codex mcp get xcodebug_marketplace and copy the effective
transport into a [mcp_servers.xcodebug_marketplace] override in your Codex
config.toml. Keep the command, arguments, working directory, and environment
from the installed server. Set tool_timeout_sec = 10800, or choose a budget
for your project. The override requires the complete transport because Codex
replaces the server entry. Verify with codex mcp get xcodebug_marketplace --json
before opening a new session.
Special installation cases
Local development or manual MCP
- pi/omp. Pi supports project scope with
-land an editable checkout withpi install /absolute/path/to/xcodebug. For local development with omp, put the extension under<agentDir>/extensions/xcodebug/. When upgrading fromxcodebug-extension, remove the old package first withpi remove npm:xcodebug-extensionoromp plugin uninstall npm:xcodebug-extension. - Claude Code and Codex. To test a local checkout as a Marketplace source,
pass its absolute path to
plugin marketplace add. For changes that should run directly from the working tree, use manual MCP with Bun and the absolute path tomcp/server.ts. In Claude Code, useclaude mcp add --scope user xcodebug -- bun /absolute/path/to/xcodebug/mcp/server.ts. In Codex, use Node.js 20 or later and runnode bin/xcodebug-setup-codex.mjsfrom the checkout. An existing npm installation providesxcodebug-setup-codex. See the manual entry point for the optional skill link. For the standalone Claude display Mod, link the checkout'sclaude/directory at${CLAUDE_CONFIG_DIR:-$HOME/.claude}/skills/xcodebug-liveif that path is free. Keep the linked checkout in place, restart the client after edits, and usedoctorto confirm the source path and digest.
Migrating from manual MCP
Install and verify the Marketplace plugin before retiring the old server. Stop old captures in the session that started them and save the old MCP entry, including custom arguments, environment variables, and timeouts. Marketplace installation leaves existing registrations in place.
- Claude Code. Confirm
plugin:xcodebug:xcodebugin/mcp. If Claude deduplicates it against a manual server with the same command and file, verify the plugin in a separate Claude configuration first. Useclaude mcp get xcodebugto identify the old registration and runclaude mcp remove --scope user xcodebugorclaude mcp remove --scope local xcodebugfrom the original project, as applicable. Check again because a local entry can hide a user entry. If enabled, disable the standalone Mod withclaude plugin disable xcodebug-live@skills-dir. - Codex. Confirm
doctorreports the installed plugin. If the footer points to the old manualxcodebugserver, change the provider toxcodebug_marketplacein the config that selects it. For the user config, you can also runnode "/verified/installedPath/bin/xcodebug-setup-codex.mjs" --migrate-marketplacewith Node.js 20 or later. UseinstalledPathfrom the verified installation JSON. The MCPtransport.cwdcan be overridden independently of that path. The script requires a user-enabled plugin and preserves default or custom providers. Usecodex mcp get xcodebugto confirm the old user-level entry, then remove it withcodex mcp remove xcodebug.
Review shared project settings with their owner before removing entries. Move
an unused manual skill symlink outside the skills directory only after checking
that no other client uses it. Open a new session and verify doctor again.
For rollback, disable the Claude Marketplace plugin with
claude plugin disable xcodebug@sublimter-xcodebug --scope user or remove the
Codex plugin with codex plugin remove xcodebug@sublimter-xcodebug. Restore the
saved MCP entry, skill link, and footer selection as applicable. In Claude Code,
use claude mcp add-json --scope user xcodebug - < /path/to/saved-entry.json
for a user entry or --scope local from the original project for a local entry.
Re-enable the standalone Claude Mod if you disabled it.
Codex live display (experimental)
The optional footer requires Codex CLI and app server 0.171.0 or later. Enable
features.tui_extensions_statusline in your Codex configuration, or pass
--enable tui_extensions_statusline for one session. Marketplace leaves the
provider selection unchanged.
If your running app server is too old, finish active tasks and captures before
running codex app-server daemon update --from-cli --yes, then
codex app-server daemon restart. Opening a new TUI does not update the server.
Start a new Codex session after setup or after updating the service or MCP
server. To change providers, open /statusline, enter Choose a status line
provider, then select xcodebug_marketplace / xcodebug_ui for Marketplace or
xcodebug / xcodebug_ui for a manual installation. A project-level override of
the same MCP server name can make the provider unavailable.
Codex 0.171.0 has a five-second provider discovery deadline. If the global MCP inventory stalls, the picker can show only the default provider even though xcodebug itself is available. Specify the provider directly for one session:
# Marketplace (for manual installs, use server="xcodebug" instead)
codex --enable tui_extensions_statusline -c 'tui.status_line_provider={server="xcodebug_marketplace",tool="xcodebug_ui"}'For a persistent selection, merge these keys into your existing config.toml
tables. For manual MCP, use server = "xcodebug" instead. The manual setup
script preserves a custom provider; leave it unchanged unless you intend to
replace it. tui.status_line controls idle fields, not the provider selection.
[features]
tui_extensions_statusline = true
[tui]
status_line_provider = { server = "xcodebug_marketplace", tool = "xcodebug_ui" }See Codex's provider configuration and discovery deadline.
The footer shows xcodebug's operation or one running capture's line count and
latest log line, including between tool calls. The count is per capture, not a
total across channels. A new launch or syslog that replaces a capture for
the same app starts a new count.
If elapsed time and quiet Ns advance while the count and latest line stay
unchanged, the footer is refreshing but that capture has no new lines to show.
This does not distinguish app silence from a stalled bridge. In the same
Codex session, use action=status to identify the running capture and
action=logs captureId=<id> to inspect what it received. A new session does
not inherit the live capture.
When no operation or capture remains, the footer restores the configured
model-with-reasoning, current-dir, context-remaining, and fast-mode
content from Codex's current statusline snapshot, in order. Unavailable
context usage or tier information is omitted rather than guessed.
The provider stays selected; xcodebug does not rewrite global settings at each
start or stop. Codex does not delegate to its native default renderer, so other
built-in items and styling are not mirrored. Clients that do not supply a
statusline snapshot receive empty idle content. The footer does not stream
logs into the model; use action=logs or action=wait for log evidence.
Long status text is shortened in the footer without changing the command or
its output.
