iosef view has two code paths that produce differently-sized images and have different window-visibility requirements:
| Invocation |
Capture source |
Output size |
Limitations |
view (no --output) |
IOSurface framebuffer (via captureSimulator) |
iOS points (1 px = 1 point) |
- |
view --output <path> |
CGWindowListCreateImage (via captureToFile) |
window pixels (Retina ~3×) |
window must be visible |
So the same command prints differently-sized images depending on whether --output is passed, and --output silently fails when the Simulator window is hidden. This type of problem occurs for CI build servers and for my own project, sandvault, where I do iOS automation from within a sandbox to hidden iOS Simulator windows.
Proposed fix
Two new subcommands that capture via the framebuffer in both no-output and file modes, so they work regardless of window state:
iosef snap-points — 1 px = 1 iOS point (coordinate-aligned with tap / describe), matches the contract view's base64 path already provides
iosef snap-pixels — native device pixel resolution, for OCR and visual diffing
Both accept --output and --type png|jpeg|tiff|bmp|gif, exposed over MCP as snap_points / snap_pixels. view is kept unchanged for backward compatibility.
Internally this shares a captureFramebufferCGImage helper (IOSurface → simctl fallback), so the existing view base64 fast path doesn't regress.
PR
I've put together a draft PR for this at webcoyote#1 — this repo's settings restrict PRs to collaborators, so I can't open it here directly. Happy to rework the approach if you'd prefer a different shape (e.g. keeping to one command with a --framebuffer flag, or making the new behavior the default for view --output).
iosef viewhas two code paths that produce differently-sized images and have different window-visibility requirements:view(no--output)captureSimulator)view --output <path>CGWindowListCreateImage(viacaptureToFile)So the same command prints differently-sized images depending on whether
--outputis passed, and--outputsilently fails when the Simulator window is hidden. This type of problem occurs for CI build servers and for my own project,sandvault, where I do iOS automation from within a sandbox to hidden iOS Simulator windows.Proposed fix
Two new subcommands that capture via the framebuffer in both no-output and file modes, so they work regardless of window state:
iosef snap-points— 1 px = 1 iOS point (coordinate-aligned withtap/describe), matches the contractview's base64 path already providesiosef snap-pixels— native device pixel resolution, for OCR and visual diffingBoth accept
--outputand--type png|jpeg|tiff|bmp|gif, exposed over MCP assnap_points/snap_pixels.viewis kept unchanged for backward compatibility.Internally this shares a
captureFramebufferCGImagehelper (IOSurface → simctl fallback), so the existingviewbase64 fast path doesn't regress.PR
I've put together a draft PR for this at webcoyote#1 — this repo's settings restrict PRs to collaborators, so I can't open it here directly. Happy to rework the approach if you'd prefer a different shape (e.g. keeping to one command with a
--framebufferflag, or making the new behavior the default forview --output).