$ show johnno1962/InjectionIII
InjectionIII is a macOS menu bar application that enables hot reloading of Swift, Objective-C, and C++ code in iOS simulators and devices. It works by watching for source file changes, recompiling them using Xcode build logs, and dynamically loading the resulting dylib into the running app using techniques like interposing, vtable patching, and Objective-C swizzling. The app consists of a daemon with a file watcher and injection server, while the client-side code (bundled as injection bundles or via the HotReloading Swift package) handles compilation and injection. It supports standalone injection without the app running, injection on real devices, and integration with SwiftUI. The codebase is mature and actively maintained, though it contains legacy C/ObjC components and is tightly coupled to Xcode build log parsing.
The LLM identified 2 files worth highlighting for reuse:
A thin Objective-C wrapper around BSD sockets providing simple string and integer read/write operations. It encapsulates a client socket and provides methods for bidirectional communication. The implementation is clean, self-contained, and could be extracted into any project needing lightweight socket I/O without external dependencies.
A Swift framework that provides method tracing, interposing, and injection support for Swift and Objective-C. It includes modules for scanning symbol tables, patching vtables, interposing functions via fishhook, and logging method calls. The framework is designed to be embedded in other projects and is reused across InjectionIII and HotReloading. It demonstrates advanced runtime manipulation techniques and is well-separated from the rest of the app.