How it works
Simulator framebuffer (IOSurface) │ SimulatorKit "screen changed" callback ▼render thread ── scale + convert (Accelerate) ──► shared memory ──► Ghostty (kitty graphics) │Ghostty mouse reports (SGR, pixels) ──► input ──► Indigo HID ──► Simulatorsimpane is one process with three threads that matter: one that hears from the simulator, one that draws, and the main thread, which reads the terminal and sends input.
- Notice. simpane registers with SimulatorKit for the simulator’s screen callbacks. When one arrives it marks the screen dirty and wakes the render thread. Nothing else happens; there is no timer and no polling.
- Re-check. The callback can arrive a few milliseconds before the framebuffer’s contents change. If the surface’s seed has not moved yet, simpane checks again after 1, 1, 2, 4, 8 and 16 ms, so the last frame of an animation is never left stale.
- Read and scale. The render thread locks the framebuffer IOSurface, reads the visible part in place, scales it to the pane’s real pixel size and swaps its colour channels in one pass with Accelerate. If the simulator redrew during the read, the frame is drawn again 25 ms later unless a newer one comes first.
- Hand over. The pixels go into a new POSIX shared-memory object, and simpane writes a kitty graphics command naming it. Ghostty reads the object and removes it.
- Pace. At most one frame is waiting for Ghostty. Its reply opens the way for the next; so does a 100 ms timeout, in case a reply is lost. Frames are also capped at 60 a second by default.
The phone’s body is a second image, drawn only when the layout changes. The header, the side bar, an open panel and a message over the phone are images too, drawn with CoreGraphics and SF Symbols when they change. Only the screen is redrawn per frame.
Scheduling
Section titled “Scheduling”The render thread works for about two milliseconds per frame and then sleeps. Left alone, macOS keeps such
a thread on an efficiency core at a low clock, where scaling a frame takes around 6 ms. simpane joins an
os_workgroup interval with a 3 ms deadline for each frame, which gets it a performance core and brings the
time back under 2 ms.
Ghostty reports the mouse in pixels (mode 1016), so a touch lands where the pointer is, not on a character cell. simpane converts each report to a position on the simulator’s screen and sends it at once through SimulatorKit’s legacy HID client, using the same Indigo messages Simulator.app sends.
- Moves are sent at most every 8 ms. The latest position waits; it is never dropped, and it is always sent before the finger lifts, so a flick keeps its speed.
- Scrolling has no native equivalent on iOS, so each wheel step moves a virtual finger; a burst of steps is one continuous drag. Near the edge of the screen the finger lifts and starts again under the pointer.
- Settling. iOS works out a fling from the finger’s last movements, and in the simulator it only hears about the finger when it moves. A finger that stops and then lifts would be flung at the speed it had before it stopped. So when the finger comes to rest, simpane reports it three more times a fraction of a point either side of where it stopped. Then a lift leaves the content where it is.
- Home. simpane sends the Home button. If the screen does not change within 0.4 s — Xcode 26 ignores the button on some devices — it brings SpringBoard to the front instead.
The private interfaces
Section titled “The private interfaces”simpane depends on Apple’s private CoreSimulator and SimulatorKit frameworks, loaded at run time from the
active Xcode. All of that code is in Sources/SimBridge. Xcode updates can change these interfaces;
simpane doctor reports what is missing.