Speed up iOS UI iteration by seeing layout or color changes without restarting the simulator
Force a SwiftUI view to redraw on save using the injection property wrapper
Reduce the feedback loop during macOS app development by injecting changed files on every save
Implement the injected() callback in a view controller to refresh state automatically after code injection
Xcode 16.3 and later require EMIT_FRONTEND_COMMAND_LINES to be enabled manually in build settings for injection to work.
InjectionIII is a developer tool for iOS and macOS apps that lets you update code in a running application without stopping it, recompiling everything, and relaunching. When you save a source file in Xcode, the tool recompiles just that file and loads the new version directly into the running simulator. Changes take effect immediately, skipping the wait that normally comes from a full rebuild. This is called hot reloading. For interface work, where you might be adjusting colors, fonts, layouts, or logic through many small iterations, the time savings add up quickly. Normally a developer saves a file, waits for the full project to compile, relaunches the simulator, navigates back to the screen they were working on, and checks the result. InjectionIII removes all but the last step. Setup involves downloading the Mac app, adding a few lines of code to your project that load the injection bundle at startup, and adding two linker flags to your debug build settings. After that, every file save triggers an automatic injection. Classes can implement a special method called injected() that runs immediately after code is updated, which you use to force a visual refresh. For SwiftUI projects, there are property wrappers available that observe injections and trigger view redraws automatically. The tool works in the iOS simulator out of the box. Running it on a real device requires additional steps and a specific app release. macOS apps require temporarily disabling the app sandbox during development. The README notes a compatibility change in Xcode 16.3: a build setting called EMIT_FRONTEND_COMMAND_LINES must be explicitly enabled for InjectionIII to work, because Xcode stopped logging the information it needs by default. There are limits to what can be injected. You cannot add, remove, or reorder stored properties, and you cannot add or remove methods on non-final classes. Private symbols in extensions may also behave unexpectedly. The README is detailed about these constraints and the workarounds available.
← johnno1962 on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.