Record a .trace via Instruments.app GUI (macOS 26.x workaround)
recordViaInstrumentsAppOpen Instruments.app to record a performance trace when xcrun xctrace fails on macOS 26.x. Watches directory for saved .trace, then inspects it for memory issues.
Instructions
[mg.build] Open Instruments.app, prompt the user to record + save a .trace, then poll a watchDir for the new bundle and chain into inspectTrace. The macOS 26.x escape hatch: xcrun xctrace record wedges on this OS but Instruments.app GUI still produces valid traces. Returns instructions[] for the user-in-loop step, tracePath when found, plus a chained inspectTrace summary. Times out after timeoutSec (default 600s). v1.16+.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| template | No | The Instruments template the user should pick after the app launches. Surfaced in the response's instructions array. Default 'Time Profiler'. Common alternatives: 'Allocations', 'Animation Hitches', 'Leaks', 'Energy Log', 'Network Profile'. | Time Profiler |
| watchDir | No | Directory to watch for the saved `.trace` bundle. When omitted, defaults to $MEMORYDETECTIVE_TRACE_ROOT (typically `~/Library/Application Support/memorydetective/traces`). The directory is created if it does not exist. | |
| timeoutSec | No | Maximum seconds to wait for the user to save a `.trace` before returning a timeout. Default 600 (10 minutes). Capped at 3600 (1 hour). | |
| preexistingTraces | No | Absolute paths to `.trace` bundles already in `watchDir`. The watcher excludes these so it only matches NEW files. When omitted, the watcher snapshots the directory at start. Optional override for callers who want explicit control. |