Capture a labeled before/after snapshot for verify-fix
captureScenarioStateCapture scenario state to bracket fixes and validate retain cycle closure. Produces memgraph, screenshot, and UI tree artifacts for diffing.
Instructions
[mg.scenario] Composite snapshot: writes a .memgraph, a .png screenshot, and a .ui.json accessibility tree into outputDir, all prefixed by label (e.g. before / after). Designed to bracket a fix or a replayScenario call so you can chain into diffMemgraphs and validate that a cycle actually closed. Sub-captures are best-effort: if leaks fails (macOS 26.x minimal-corpse), the screenshot + UI tree still complete and the captureMemgraph workaroundNotice is surfaced for follow-up. Required: simulatorUDID, outputDir, and exactly one of pid / appName.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| simulatorUDID | Yes | UDID of the booted simulator hosting the target app. Used for screenshot + UI tree captures. | |
| pid | No | PID of the host-side app process. Mutually exclusive with `appName`. Pass the value returned by bootAndLaunchForLeakInvestigation. | |
| appName | No | App executable name as visible in pgrep. Mutually exclusive with `pid`. | |
| outputDir | Yes | Absolute directory where the snapshot files are written. Created if it does not exist. | |
| label | No | Filename prefix for the captured artifacts. Use "before" / "after" for verify-fix flows. | snapshot |
| include | No | Which artifacts to capture. Default captures all three. |