How ethanarbuckle/simulator-trainer works
Project type and purpose
• This is a macOS “full-stack” Cocoa application plus a privileged helper, designed to install iOS apps and jailbreaking tweaks (.deb) into Apple’s iOS Simulator.
• From the README: it mounts a tmpfs overlay on the simulator runtime, converts non-sim binaries, injects loaders into libobjc.A.dylib, and supports interactive tracing (via Cycript, FLEX, etc.).
File structure
Top-level targets/directories:
• simulator-trainer (Xcode app):
• Common – shared Obj-C utilities (CommandRunner, CycriptLauncher, ObjseeTraceLauncher, logging)
• Injection – binary patcher and tmpfs overlay C code
• Patching – in-process simulator swizzling, dylib conversion, platform toggling
• PrivilegedHelper – XPC protocol objects (HelperConnection, SimInjectionOptions, SimRuntimeHelperProtocol)
• SimDevices – services for managing and orchestrating Simulator devices (SimDeviceManager, PackageInstallationService, etc.)
• UI – MVC layers (AppDelegate, ViewController, drag-and-drop target, terminal window controller)
• Supporting Files – storyboards, entitlements, bundled bootstrap payloads (CydiaSubstrate, FLEX.dylib, cycript, loader.dylib, optool)
• SimRuntimeHelper (launchd-blessed helper): Privileged daemon sources + plist + entitlements
• SMJobBlessUtil.py: script to install the helper via SMJobBless
• external: SwiftTerm.framework (embedded terminal UI) and libobjsee-static.a (hooking/tracing library)
• hooks: Obj-C code that gets injected into the simulator process
README for additional insights
• Describes the 3 primary operations: tweak install, app install, Objective-C tracing
• Mentions “in-process swizzling”, “tmpfs overlay per runtime version”, “loader injection”
Elements
• UI → SimDeviceManager → Injection Engine
• Injection Engine → XPC → SimRuntimeHelper
• SimRuntimeHelper → OS (mount overlay, file operations)
• UI ← status callbacks (via XPC or SwiftTerm stdout)
• Blue for UI components
• Green for domain/injection services
• Red for privileged helper
• Purple for the external Simulator process
• Orange for third-party frameworks/libraries