Comments (18)
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.
from injectioniii.
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!
from injectioniii.
Thanks for raising the issue. It cleared up all sorts of things :)
from injectioniii.
Hi, the connection refused message is normal when you're not running the app. The other message happens when you have added the "HotReloading" Swift package at some point in the past and it picks up the wrong version of the SwiftTrace framework from derived data. You'll need to do a clean build to clear the wrong version out.
from injectioniii.
Hi, the connection refused message is normal when you're not running the app. The other message happens when you have added the "HotReloading" Swift package at some point in the past and it picks up the wrong version of the SwiftTrace framework from derived data. You'll need to do a clean build to clear the wrong version out.
Hi, thanks for the reply! What do you mean by "when you're not running the app"? Both the InjectionIII app and my projects app in the simulator are running and I selected the associated project directory.
I also tried resetting the Swift Package Manager Cache, cleaned the project, deleted Derived Data and restarted my machine. 🤔
from injectioniii.
Hmmm.. Remove https://github.com/johnno1962/HotReloading as a dependency. You either use that (rarely these days) or the app bundles. If you use both at the same time you get this error.
from injectioniii.
Hmmm.. Remove https://github.com/johnno1962/HotReloading as a dependency. You either use that (rarely these days) or the app bundles. If you use both at the same time you get this error.
Ah interesting, I saw a video where someone did both and it seemed to work, so I thought that's the way to go. What setup would you recommend? Primarily I would like to use it with the visionOS simulator, the actual Vision Pro device and with a Mac (Catalyst) app.
I tried removing the HotReloading dependency but that yields in the same error (connection refused). If I load the bundle manually I get:
`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
Referenced from: <6E51BEA0-FB33-3620-9771-2B52DA5CF83E> /Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle/iOSInjection
Expected in: <B31C28E6-BD26-31E1-A706-046DFD36C763> /Users/<...>/Library/Developer/Xcode/DerivedData/SGMaterial_Playground-cmnrfbyrdzlqugfcvcotswsakavf/Build/Products/Debug-iphonesimulator/PackageFrameworks/SwiftTrace.framework/SwiftTrace`
Very odd. Xcode is installed via Xcodes app(https://www.xcodes.app) if that has any relevance.
from injectioniii.
Ignore the "connection refused" if you are not using the app. If you have removed the HotReloading Package did you perform a build clean afterwards? If you have a visionOS device I'd be very interested in knowing if you were able to get that working. There is a release candidate which should have support for that. I can talk you through that once you're up and running.
from injectioniii.
Ignore the "connection refused" if you are not using the app. If you have removed the HotReloading Package did you perform a build clean afterwards? If you have a visionOS device I'd be very interested in knowing if you were able to get that working. There is a release candidate which should have support for that. I can talk you through that once you're up and running.
Thanks for your help again! :) Got it running now in the Simulator after removing the HotReloading package and doing a clean build. Very cool!
I am a little confused though: There is the standalone app (which I assume I can just use as such), the Inject swift package and then the HotReloading package. Which should I use when? Or are they just different wrappers with the same goal?
Currently I have the Injection 3 App running and use the Inject Swift Package.
In this video he is importing both packages and it seems to work, which got me confused:
https://www.loom.com/share/c3331721a6ff47b9a66b30e7b59c6afc
Device injection (on iOS) seems to be working mostly but fails during loading of .dylib:
💉 Connecting to <…>...
💉 InjectionIII connected <…>
💉 Watching files under the directory <…>
💉 Compiling <…>
💉 Selecting Xcode /Applications/Xcode-15.3.0-Beta.2.app/Contents/Developer
💉 Loading .dylib ...
💉
Yes, I have a visionOS device and would love to get it working there as well!
from injectioniii.
Update: Got it running now on my Mac and Vision Pro :)
I switched to the HotReloading Package instead of Inject though. But weirdly on my iPhone I still get this dlopen error:
🔥 ⚠️ dlopen() error: dlopen(/private/var/mobile/Containers/Data/Application/89D3960F-D1CF-46F5-A331-994FBB129419/tmp/eval102.dylib, 0x0002): tried: '/usr/lib/system/introspection/eval102.dylib' (no such file, not in dyld cache), '/private/var/mobile/Containers/Data/Application/89D3960F-D1CF-46F5-A331-994FBB129419/tmp/eval102.dylib' (code signature in <A0AFCA02-4C0E-319F-A389-D66F89DAA71C> '/private/var/mobile/Containers/Data/Application/89D3960F-D1CF-46F5-A331-994FBB129419/tmp/eval102.dylib' not valid for use in process: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.), '/private/preboot/Cryptexes/OS/private/var/mobile/Containers/Data/Application/89D3960F-D1CF-46F5-A331-994FBB129419/tmp/eval102.dylib' (no such file), '/private/var/mobile/Containers/Data/Application/89D3960F-D1CF-46F5-A331-994FBB129419/tmp/eval102.dylib' (code signature in <A0AFCA02-4C0E-319F-A389-D66F89DAA71C> '/private/var/mobile/Containers/Data/Application/89D3960F-D1CF-46F5-A331-994FBB129419/tmp/eval102.dylib' not valid for use in process: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.) 🔥 ⚠️ Injection error: Error Domain=SwiftEval Code=-1 "dlopen() error: dlopen(/private/var/mobile/Containers/Data/Application/89D3960F-D1CF-46F5-A331-994FBB129419/tmp/eval102.dylib, 0x0002): tried: '/usr/lib/system/introspection/eval102.dylib' (no such file, not in dyld cache),
from injectioniii.
OK, so I've read your message properly now. You've got injection working on a Vision Pro! and now it doesn't work on a device? That is likely just a code signing problem. What configuration are you running at the moment? HotReloading on a device? I've checked it and can't see a problem on my machine at the moment.
from injectioniii.
OK, so I've read your message properly now. You've got injection working on a Vision Pro! and now it doesn't work on a device? That is likely just a code signing problem. What configuration are you running at the moment? HotReloading on a device? I've checked it and can't see a problem on my machine at the moment.
Hi, so it's working on all the Simulators, my Mac and my Vision Pro (on device 🎊). The only time where I'm now getting this issue is on my physical iPhone 14 Pro device. Xcode Beta 15.3.0, Sonoma 14.1.2
I also now removed the HotReloading package and opted for just loading everything manually using the code generated by the Injection app when selecting -> Prepare Project
Still runs fine, only issue left is the dlopen (only!) on the physical iPhone device.
from injectioniii.
Interestingly enough, on the physical Vision Pro device I could load the iOSInjection bundle and it still worked. Probably similar enough ->
// Running on Real Device let resourceName: String #if os(macOS) || targetEnvironment(macCatalyst) resourceName = "macOSInjection" #elseif os(visionOS) resourceName = "iOSInjection" // seems to work without using xrOSInjection #else resourceName = "iOSInjection" #endif guard let bundlePath = Bundle.main.path(forResource: resourceName, ofType: "bundle"), let bundle = Bundle(path: bundlePath), bundle.load() else { fatalError() }
from injectioniii.
Very, very weird about the bundles. Where is that code you pasted in coming from?
And visionOS is actually injecting now? That would be awesome! Not sure what's happening on the iOS device. I've seen the error you're seeing today whereas it's worked before. Trying to factor out between new Xcode, new iOS version, changes to InjectionIII etc. It should be code signing correctly.
from injectioniii.
Very, very weird about the bundles. Where is that code you pasted in coming from?
And visionOS is actually injecting now? That would be awesome! Not sure what's happening on the iOS device. I've seen the error you're seeing today whereas it's worked before. Trying to factor out between new Xcode, new iOS version, changes to InjectionIII etc. It should be code signing correctly.
Here is the helper snippet I'm using (collected from a couple different sources, mostly "Prepare Project" helper):
https://gist.github.com/arthurschiller/a4471129584d11e9b358d99bad4aa0dc
Yeah visionOS works totally fine :)
Video attached:
https://github.com/johnno1962/InjectionIII/assets/3637723/0d38006a-a4f2-49d0-b881-2582abc5c357
I can try it maybe with another iPhone.
from injectioniii.
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!
Awesome, thanks so much for this project! Already seeing how this will greatly accelerate my workflow :)
from injectioniii.
I've updated the release candidate with this fix. You should find on-iOS device injection is working again. Thanks for the link to @gonchar's excellent video. I had no idea people had already got injection working on a visionOS device (as it should!)
from injectioniii.
I've updated the release candidate with this fix. You should find on-iOS device injection is working again. Thanks for the link to @gonchar's excellent video. I had no idea people had already got injection working on a visionOS device (as it should!)
Excellent, that did the trick! Thanks so much! :)
from injectioniii.
Related Issues (20)
- error: no such module 'FirebaseFirestoreInternalWrapper' HOT 4
- Error loading, when using mac target HOT 3
- Crash on reload every time HOT 6
- Loading .dylib has failed HOT 15
- EOF received from server.. HOT 2
- Setting up for macOS app dev HOT 21
- Is there a way to make injected macOS app not become active when it's reloaded? HOT 2
- Re-compilation failed HOT 5
- Hello, I reported the error when I used the real machine to debug, looking forward to your answer, thank you HOT 6
- Meaning of colors HOT 2
- It doesn't work on Xcode 15.3 iOS 17.4 HOT 14
- It doesn't work on xcode 15.3 (15E204a) HOT 7
- Loading .dylib has failed HOT 1
- TCA ObservableState crash HOT 3
- Unknown argument: -interposable HOT 2
- Could not bind service socket: Address already in use HOT 5
- Is support arm mac??? HOT 19
- ld: building for 'iOS', but linking in object file built for 'visionOS-simulator' HOT 5
- dlopen() error: Library not loaded: @rpath/libswift_Concurrency.dylib HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from injectioniii.