Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions InjectionBundle/XprobeSwift-Bridging-Header.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#import "SimpleSocket.h"
#import "UserDefaults.h"
#import "InjectionClient.h"
#import "InjectionTouchEvents.h"
#if SWIFT_PACKAGE
#import "../XprobePlugin/Sources/Xprobe/include/Xprobe.h"
#endif
Expand Down
109 changes: 93 additions & 16 deletions InjectionIII.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion InjectionIII/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>8233</string>
<string>8431</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.developer-tools</string>
<key>LSMinimumSystemVersion</key>
Expand Down
2 changes: 1 addition & 1 deletion InjectionIII/InjectionIII-Bridging-Header.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
#import "RMWindowController.h"
#import "../XprobePlugin/Sources/XprobeUI/include/XprobePluginMenuController.h"
#endif

#import "/tmp/InjectionNextSalt.h"
#import "DDHotKeyCenter.h"
#import <libproc.h>
18 changes: 15 additions & 3 deletions InjectionIII/build_bundles.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Created by John Holdsworth on 04/10/2019.
# Copyright © 2019 John Holdsworth. All rights reserved.
#
# $Id: //depot/ResidentEval/InjectionIII/build_bundles.sh#92 $
# $Id: //depot/ResidentEval/InjectionIII/build_bundles.sh#100 $
#

# Injection has to assume a fixed path for Xcode.app as it uses
Expand Down Expand Up @@ -43,14 +43,14 @@ function build_bundle () {
}

#build_bundle macOS MacOSX macosx &&
if [ "$(hostname)" != "Johns-MacBook-Air.local" ]; then
if [ "$CONFIGURATION" = "Release" ]; then
build_bundle xrOS XRSimulator xrsimulator
build_bundle tvOS AppleTVSimulator appletvsimulator &&
build_bundle watchOS WatchSimulator watchsimulator
build_bundle tvdevOS AppleTVOS appletvos
build_bundle xrdevOS XROS xros
fi
build_bundle iOS iPhoneSimulator iphonesimulator &&
build_bundle tvOS AppleTVSimulator appletvsimulator &&

# iphoneos on M1 mac (requires Sandbox switched off)
build_bundle maciOS iPhoneOS iphoneos &&
Expand All @@ -67,6 +67,18 @@ for thing in Modules Resources Headers; do
ln -sf Versions/Current/$thing $CODESIGNING_FOLDER_PATH/Contents/Resources/macOSInjection.bundle/Contents/Frameworks/SwiftTrace.framework
done &&

cp -f InjectionNext/App/InjectionNext/swift-frontend.sh $CODESIGNING_FOLDER_PATH/Contents/Resources &&

rsync -au \
--exclude node_modules \
--exclude .npm \
--exclude 'npm-debug.log*' \
--exclude .DS_Store \
InjectionNext/mcp-server "$CODESIGNING_FOLDER_PATH/Contents/Resources" &&
perl -pi.bak -e 's@InjectionNext@InjectionIII@g' \
$CODESIGNING_FOLDER_PATH/Contents/Resources/{mcp-server/README.md,swift-frontend.sh} &&
rm $CODESIGNING_FOLDER_PATH/Contents/Resources/{mcp-server/README.md,swift-frontend.sh}.bak &&

# This seems to be a bug producing .swiftinterface files.
perl -pi.bak -e 's/SwiftTrace.(Swift(Trace|Meta)|dyld_interpose_tuple|rebinding)/$1/g' $CODESIGNING_FOLDER_PATH/Contents/Resources/{macOSInjection.bundle/Contents,{i,maci,tv,xr}OSInjection.bundle}/Frameworks/SwiftTrace.framework/Modules/*/*.swiftinterface &&
perl -pi.bak -e 's@(import _Concurrency)@// $1@g' $CODESIGNING_FOLDER_PATH/Contents/Resources/{macOSInjection.bundle/Contents,{i,maci,tv,xr}OSInjection.bundle}/Frameworks/SwiftTrace.framework/Modules/*/*.swiftinterface &&
Expand Down
12 changes: 0 additions & 12 deletions InjectionIII/swift-frontend.sh

This file was deleted.

2 changes: 1 addition & 1 deletion InjectionNext
Submodule InjectionNext updated 101 files
30 changes: 18 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@ will if you use "Editor/Add Build Setting/Add User-Defined Setting"
to add a value for `EMIT_FRONTEND_COMMAND_LINES` (set to "YES") to your project's
`Debug` build settings, then InjectionIII can continue to work as before.

Versions 5.2.1+ of the app support an MCP server contained in the `Resources`
directory of the app bundle. Consult mcp-server/README.md for details.
Running the server is opt-in by setting the default `mcpServer` to true.

### InjectionNext

InjectionIII now has a start-over successor in the very similar
[InjectionNext](https://github.com/johnno1962/InjectionNext) project.
If you encounter a limitation of InjectionIII it's recommended giving
InjectionNext a try to see if the issue has been resolved there.

### How to use it

Setting up your projects to use injection is now as simple as downloading
Expand All @@ -42,7 +53,8 @@ Bundle(path: "/Applications/InjectionIII.app/Contents/Resources/macOSInjection.b
```
It's also important to add the options `-Xlinker` and `-interposable` (without double
quotes and on separate lines) to the "Other Linker Flags" of targets in your project
(for the `Debug` configuration only) to enable "interposing" (see the explanation below).
to enable "interposing" (see the explanation below). This must be for the `Debug`
configuration only or you can experience problems with TestFlight.

![Icon](interposable.png)

Expand Down Expand Up @@ -141,14 +153,6 @@ var body: some View {
You can leave these modifications in your production code as,
for a `Release` build they optimise out to a no-op.

#### Xcode 16

New in Xcode 16 is `SWIFT_ENABLE_OPAQUE_TYPE_ERASURE` build setting.
This setting is turned ON by default and you don't need to erase view
body explicitly. You'll still need to `@ObserveInjection` to force redraws.

For more info, see [Xcode 16.2 release notes](https://developer.apple.com/documentation/xcode-release-notes/xcode-16_2-release-notes).

### Injection on an iOS, tvOS or visionOS device

This can work but you will need to actually run one of the [github
Expand Down Expand Up @@ -272,8 +276,8 @@ minimal implementation of standalone injection for reference. Just add
this Swift package and you should be able to inject in the simulator.

[InjectionNext](https://github.com/johnno1962/InjectionNext) is a
currently experimental version of Injection that should be faster and
more reliable for large projects. It integrates into a debugging flag of
new start-over version of Injection that should be faster and more
reliable for large projects. It integrates into a debugging flag of
Xcode to find out how to recompile files to avoid parsing build logs
and re-uses the client implementation of injection from `InjectionLite`.
To use with external editors such as `Cursor`, InjectionNext can also
Expand Down Expand Up @@ -330,6 +334,8 @@ store edge paths so they can be coloured (line 66 and 303) in "canviz-0.1/canviz
It also includes [CodeMirror](http://codemirror.net/) JavaScript editor
for the code to be evaluated using injection under an MIT license.

After 100 injections you'll be reminded you can sponsor this project on GitHub.

The fabulous app icon is thanks to Katya of [pixel-mixer.com](http://pixel-mixer.com/).

$Date: 2025/04/07 $
$Date: 2026/05/25 $