Skip to content

About

Reverse engineering the iOS Simulator: CoreSimulator, status bar internals, and a debug app built on private APIs.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

English | 中文

simulator-re

Reverse engineering the iOS Simulator: tracing status bar overrides from CoreSimulator all the way to SpringBoard, reconstructing iOS 17.4 & iOS 27.0 status bar icons down to 0-pixel RGBA diff, and building tools that drive the live simulator status bar without xcrun simctl.

StatusBarLab live demo: switching presets updates the simulator status bar time, battery, and signal icons in real time

Verified Results

All geometric reconstructions were verified directly against exported SpringBoard layers, paths, and rendered simulator screenshots (baseline commit 33c5722):

Area Verification Scope & Result
Battery Cap & Geometry (iOS 17.4) 0 control-point diff across 8 cap paths (circle ∩ rect arc slice vs. complex dual-corner branch)
Signal Icons (iOS 17.4) 0 alpha diff across 84 rendered Wi-Fi & cellular images across notch / Dynamic Island sizes
New Wi-Fi & Cellular (iOS 27.0) 0 RGBA diff across 190 Wi-Fi renders (19 states); ≤ 1.78e-15 error across 480 cellular bars
Provider & Style Selection 516 comparisons on iOS 17.4 + 171 on iOS 27.0 mapping display geometry → provider → iconScale → iconSize & per-item rounded
Apple Sketch vs. Runtime Read iOS 18 & 27 Apple Sketch files (10 consistent cache/original records): normal battery fill r=2.5 (border r≈4.3), Control Center fill r≈3.33, CC cap = Oval − Rectangle (booleanOperation=1)
State Replay 6 replay suites passed across iOS 17.4 and 27.0 (10 checked screenshots + 3 comparison figures)

iOS 17.4 battery cap geometry: circle-rectangle intersection vs complex dual rounded corners

Runtime comparison of normal status bar vs expanded Control Center on iOS 17.4 (iPhone 15 Pro) and iOS 27.0 (iPhone 17 Pro)

iOS 18 Sketch battery measurements: normal vs Control Center corner radii and boolean subtraction cap

What's Included

Component Description
simre Swift CLI (Sources/simre/) that lists, boots, shuts down, and overrides simulator status bars without linking private frameworks or shelling out to simctl
StatusBarLab SwiftUI app (apps/StatusBarLab/) writing directly to the simulator's status-bar-overrides domain without a host process
Low Power Mode Yellow battery state that neither xcrun simctl status_bar nor SimDevice exposes
Disassembly & Probes Runtime ObjC/Swift introspection (simprobe), SpringBoard update tracing (sbtrace), LLDB annotation script (tools/lldb/annotate.py), and automated pixel/path verifiers (tools/battery, tools/signals, tools/providers, tools/sketch, tools/statusbar)

Battery States

Rendered directly inside the simulator via StatusBarLab:

Nine battery states including discharging, low battery, charging, charged, not charging, and Low Power Mode

Color priority is Low Power > Low Battery > Charging > Default. The lightning bolt is evaluated independently, allowing combinations like red fill + bolt.

How the Status Bar Pipeline Works

simre / simctl
  → SimDevice → CoreSimulatorBridge (inside Simulator)
  → status-bar-overrides domain ← StatusBarLab writes directly here
  → systemstatusd
  → SpringBoard: STUIStatusBarDataAggregator
  → STUIStatusBar on SBStatusBarWindow

A few notable findings from disassembly & runtime probing:

  • Xcode 27 replaces Simulator.app with DeviceHub.app.
  • The status bar does not live inside your app process—it is an independent SBStatusBarWindow hosted by SpringBoard above app windows.
  • The time override field has no format check (it happily renders hello).
  • Battery level ≤ 1% clamps to 0; the low-battery threshold is 20% (10% constant on iPad).
  • Forwarding internals inside systemstatusd remain static-evidence only in this baseline.

Quickstart

Requires macOS, Xcode 27, and the iOS 27.0 Simulator runtime.

Run the SwiftUI lab app:

open apps/StatusBarLab/StatusBarLab.xcodeproj

Or build and run the simre CLI:

swift build
.build/debug/simre list
.build/debug/simre boot <name-or-UDID>
.build/debug/simre statusbar <device> time 9:41
.build/debug/simre statusbar <device> battery 1 42    # state: 0 discharging, 1 charging, 2 charged
.build/debug/simre statusbar <device> wifi 3 2        # mode 3 active, 2 bars
.build/debug/simre statusbar <device> clear
.build/debug/simre shutdown <device>

Launch StatusBarLab with --demo to cycle through all presets automatically:

xcrun simctl launch <device> dev.ieuforu.StatusBarLab --demo

Directory Layout

Path Contents
Sources/simre/ Host-side Swift CLI
apps/StatusBarLab/ Simulator SwiftUI app and UI tests
tools/simprobe/ ObjC class introspection inside the Simulator
tools/sbtrace/ SpringBoard injection probe for status bar updates
tools/lldb/annotate.py LLDB script annotating constants and ivar names in disassembly
tools/ovrtest/ Early prototypes publishing status bar overrides directly
tools/battery/ Real battery capture, parameter export, independent redraw & pixel diff
tools/signals/ Wi-Fi / cellular probes, SpringBoard capture, redraws & alpha verification
tools/providers/ Provider selection tests, per-item style capture & disassembly export
tools/sketch/ Read-only Sketch hierarchy/geometry/path extractor & source hash verifier
tools/statusbar/ Control Center capture, iOS 27 signal/rule verification, replay & comparison figures
notes/ Detailed research notes (in Chinese) + machine-readable .asm/.json in notes/evidence/

Research Notes (Chinese)

  1. Architecture & Device Boot
  2. Status Bar Pipeline & App Internals
  3. Reconstructing the Battery View from Disassembly
  4. Legacy Battery Icon: iOS 17.4
  5. Modern Battery Icon: iOS 27
  6. Legacy Battery Cap, Continuous Corners & Path Verification
  7. Legacy Wi-Fi, Cellular & Notch / Dynamic Island Geometry
  8. Provider Selection, iconSize & Per-Item rounded Overrides
  9. Two Apple Sketch Files: Normal Status Bar vs. Control Center
  10. From Design Files to Runtime: Expanded Mode, New Wi-Fi & Corner Tables

Scope & Limitations

  • Experiments cover Xcode 27.1 and selected samples on iOS 17.4 / 27.0 Simulator runtimes; iOS 18 values come from Apple Sketch files only (no iOS 18 runtime dynamic verification).
  • Simulator-only: private APIs are volatile and cannot be shipped on real devices or the App Store.
  • Out of scope: real hardware, full RTL, dual-SIM, landscape, Display Zoom, full search-animation frames, and secondary indicators (location, VPN, call/recording pills, iPad/CarPlay).
  • Running xcodebuild test while DeviceHub is open was observed to shut down simulators and exit DeviceHub.

Disclaimer

Personal research project, not affiliated with Apple. Reconstructed algorithms and code are independent research derived from disassembly and runtime measurements, not Apple original source code; Sketch measurements retain their design-file provenance and do not claim equivalence to runtime rendering.

About

Reverse engineering the iOS Simulator: CoreSimulator, status bar internals, and a debug app built on private APIs.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages