Skip to content
This repository was archived by the owner on Mar 11, 2024. It is now read-only.

Commit c3c19c8

Browse files
committed
Improve wording on adding -Xlinker -interpose flags.
1 parent f2d063d commit c3c19c8

File tree

2 files changed

+23
-18
lines changed

2 files changed

+23
-18
lines changed

README.md

+19-14
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ holding it correctly and don't ask too much of it, it should "just work".
6262

6363
### Getting Started
6464

65-
To use injection, download the app from the App Store and run it. Then, you must add `"-Xlinker -interposable"` (without the double quotes) to your project's `"Other Linker Flags"` for the Debug target (qualified by the simulator SDK to avoid complications with bitcode). Finally, add one of the following to your application delegate's `applicationDidFinishLaunching:`
65+
To use injection, download the app from the App Store and run it. Then, you need to add "-Xlinker -interposable" (without the double quotes) to the "Other Linker Flags" of all targets in your project for the Debug configuration (qualified by the simulator SDK to avoid complications with bitcode). Finally, add one of the following to your application delegate's `applicationDidFinishLaunching:`
6666

6767
Xcode 10.2 and later (Swift 5+):
6868

@@ -106,6 +106,10 @@ If you want to build this project from source (which you may need to do to use i
106106

107107
git clone https://github.com/johnno1962/InjectionIII --recurse-submodules
108108

109+
If you're looking to understand how the app works it's magic, it's not a
110+
short story but the staring point is the [ROADMAP.md](ROADMAP.md)
111+
file in this repo.
112+
109113
### Available downloads
110114

111115
| Xcode 10.2+ | Monterey & Xcode 13 |
@@ -124,16 +128,16 @@ case insensitve filesystems.
124128

125129
[HotReloading Project](https://github.com/johnno1962/HotReloading):
126130
A version of InjectionIII that works just by adding this Swift Package to
127-
your project. See the repo README for details. Remember not to leave
128-
this package configured into your project for a release build or it will bloat
129-
your app binary!
131+
your project (and adding the -interposable linker flag). See the repo
132+
README for details. Remember not to leave this package configured
133+
into your project for a release build or it will bloat your app binary!
130134

131135
**On-Device Injection**: Instead of loading the `iOSInjection.bundle`,
132136
add the [HotReloading](https://github.com/johnno1962/HotReloading)
133-
Swift Package to your project and add a "Build Phase" above to run the
134-
`injectiond` daemon version of the InjectionIII.app and you should be
135-
able to perform injection on a iOS or tvOS device. For more detail and the
136-
limitations of this new feature, see the README of the
137+
Swift Package to your project and add a "Build Phase" in the README
138+
to run the `injectiond` daemon version of the InjectionIII.app and you
139+
should be able to perform injection on a iOS or tvOS device. For more
140+
detail and the limitations of this new feature, see the README of the
137141
[HotReloading](https://github.com/johnno1962/HotReloading) project.
138142

139143
### Limitations/FAQ
@@ -213,20 +217,21 @@ class when an instance is injected, a sweep of all live objects in your
213217
app is performed. This has two limitations. The instance needs to be
214218
"seen" by a reference to a reference to a reference from an initial set
215219
of seed instances e.g. appDelegate, rootViewController. Secondly,
216-
technically this is ambitious and can crash for some app states.
220+
technically this is ambitious and can crash for some app states or
221+
if you use `unowned` properties.
217222
If you encounter this, provide a value for the environment variable
218223
**INJECTION_SWEEP_DETAIL** and, as it sweeps it will print the type
219224
name of the object about to be swept. If you see a crash, from version
220225
3.2.2 you can exclude the type shown just before the crash using the
221226
**INJECTION_SWEEP_EXCLUDE** environment variable (which can
222227
be a regular expression).
223-
224228
**INJECTION_OF_GENERICS** It is possible to inject the methods
225229
of generic classes but this requires a "sweep" of live objects to
226-
find the specializations in use so the feature has been made opt-in.
227-
**INJECTION_UNHIDE** Allows users to opt-into the lecacy processing
230+
find the specializations in use (as they each have their own vtables)
231+
so the feature has been made opt-in.
232+
**INJECTION_UNHIDE** Allows users to opt-into the legacy processing
228233
of defualt arguments symbols using the "unhide" which may be required
229-
for larger projects.
234+
for larger projects. Otherwise it will still occur "on demand".
230235

231236
As the application is now released with debug information, if you experience a
232237
crash inside the Injection.bundle use the following command to clone the InjectionIII
@@ -461,4 +466,4 @@ for the code to be evaluated using injection under an MIT license.
461466

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

464-
$Date: 2022/04/07 $
469+
$Date: 2022/04/09 $

ROADMAP.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ An instance of the class runs in the simulator for the Sandboxed version of the
3535
main app process for the binary github releases.
3636

3737
[HotReloading/SwiftInjection.swift](https://github.com/johnno1962/HotReloading/blob/main/Sources/HotReloading/SwiftInjection.swift): After
38-
the dynamic library prepared by SwiftEval.swift has be dlopen()'d this file sets about the actual
38+
the dynamic library prepared by SwiftEval.swift has been dlopen()'d this file sets about the actual
3939
injection of the new implementations into the client app. It does this three ways. For
4040
Objective-C methods it "Swizzles" the new implementations on top of the old using
4141
Objective-C runtime apis. For Swift classes it scans class information, the later
@@ -49,8 +49,8 @@ needs to have been linked with the option "-interposable" which makes all functi
4949
global symbols indirect through a patchable pointer as described
5050
[here](https://www.mikeash.com/pyblog/friday-qa-2012-11-09-dyld-dynamic-linking-on-os-x.html).
5151

52-
A new final part of injecting a newly compiled source file is the "reversee interpose" of the
53-
"mutable accessors" or top level and static variables which redirects newly injected code to
52+
A new final part of injecting a newly compiled source file is the "reverse interpose" of the
53+
"mutable accessors" for top level and static variables which redirects newly injected code to
5454
take their value from the main app bundle rather than have them reinitialise with each injection.
5555

5656
[HotReloading/UnhidingEval.swift](https://github.com/johnno1962/HotReloading/blob/main/Sources/HotReloading/UnhidingEval.swift). This was introduced as a means of overriding functionality in SwiftEval.swift without making it
@@ -99,5 +99,5 @@ A startover implementation of injection for use in the simulator with the
9999
HotReloading project which removes the need for the App itself.
100100

101101

102-
$Date: 2022/04/01 $
102+
$Date: 2022/04/09 $
103103

0 commit comments

Comments
 (0)