InjectionIII: InjectionClient/Could not connect: Connection refused 🔥

Hi,

I finally wanted to implement Injection into my workflow. I think I’ve followed all the steps from readme but every time in run my project I get this console message: InjectionClient/Could not connect: Connection refused 🔥 Unable to connect to InjectionIII app, falling back to standalone HotReloading.

Error loading /Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle/iOSInjection (82): dlopen(/Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle/iOSInjection, 0x0109): Symbol not found: _$sSS10SwiftTraceE11OffsetIndexO4lastyACSS_S2btcACmFWC

Here are the steps I’ve taken:

  1. Get InjectionIII App: https://github.com/johnno1962/InjectionIII/releases

2. Install Dependencies: https://github.com/johnno1962/HotReloading https://github.com/krzysztofzablocki/Inject

3. Add Linker (DEBUG) Flags: -Xlinker and -interposable

4. Load Bundle on App Init #if DEBUG #if os(visionOS) Bundle(path: “/Applications/InjectionIII.app/Contents/Resources/xrOSInjection.bundle”)?.load() #elseif targetEnvironment(macCatalyst) Bundle(path: “/Applications/InjectionIII.app/Contents/Resources/macOSInjection.bundle”)?.load() #else Bundle(path: “/Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle”)?.load() #endif #endif

I’ve tested it with Xcode 15.2.0 and Xcode 15.3.0 Beta 2. OS is Sonoma 14.1.2

It’s probably something simple but I would appreciate any hints. Thank you!

About this issue

  • Original URL
  • State: closed
  • Created 4 months ago
  • Comments: 18 (9 by maintainers)

Most upvoted comments

Thanks for raising the issue. It cleared up all sorts of things 😃

Found the silly problem due to renaming a file which was taking out code signing and I’ll release a new release candidate this evening. Thanks for checking all these things out!

We’re making progress. There are a few moving part to injection and they evolve so it can be confusing. The original injection was The app performing the recompiling and the bundle doing the actual injection then I discovered the bundle could do it all in the simulator. For a real device, you can’t load the bundle off your Mac’s filesystem so the contents of the bundle are available in the HotReloading package. Then someone pointed out that you can copy a bundle into your app and load that instead of off the filesystem if you use the “copy_bundle.sh” script from the app’s resources as a build phase.

I’ve just seen your new message. You’re very nearly there using the HotReloading project which is fine. It’s strange it’s not seeing the dylib file but to my knowledge this is the first time someone has tried on an actual visionOS device. Do you have the option to zoom on this? I’d like to see this running if it’s possible.