johnno1962 / InjectionIII

Re-write of Injection for Xcode in (mostly) Swift
MIT License
4.06k stars 319 forks source link

Connection issues #317

Closed PatrikTheDev closed 3 years ago

PatrikTheDev commented 3 years ago

Hey! I'm trying to use InjectionIII/HotReload in my app. It loads just fine but I get a connection error. 2021-05-05 12:00:48.996009+0200 Tabataa[8953:2122796] Could not connect: Connection refused 🔥 ⚠️ HotReloading loaded but could not connect. Is injectiond running? ⚠️ 🔥 Have you added the following "Run Script" build phase to your project to start injectiond? if [ -d $SYMROOT/../../SourcePackages ]; then $SYMROOT/../../SourcePackages/checkouts/HotReloading/start_daemon.sh elif [ -d "$SYMROOT"/../../../../../SourcePackages ]; then "$SYMROOT"/../../../../../SourcePackages/checkouts/HotReloading/fix_previews.sh fi 2021-05-05 12:01:36.230675+0200 Tabataa[8953:2122394] dnssd_clientstub read_all(11) DEFUNCT 2021-05-05 12:04:52.126077+0200 Tabataa[8953:2122394] dnssd_clientstub read_all(11) DEFUNCT

Also happens with the provided SwiftUI example. Xcode 12.5 (freshly downloaded), macOS 14.4 beta, iOS 14.6 beta

johnno1962 commented 3 years ago

Have you added the "Run Script" build phase to your project? HotReloading needs a daemon to connect to,

PatrikTheDev commented 3 years ago

Yes, I did (and the example project already had it there but I replaced it with the one from the README because the paths were incorrect)

I see the menubar icon and it says the server is running (or at least it has the tick there and I tried to click start server)

PatrikTheDev commented 3 years ago

Weirdly enough it seems to work in the simulator after a clean build, I'll try on a real device again

johnno1962 commented 3 years ago

Are you trying to run it on a real device? HotReloading only works in the simulator.

PatrikTheDev commented 3 years ago

Oh, I didn't know that, I didn't see it mentioned anywhere so I assumed it should just work, don't have much experience with swizzling/swapping implementations. Closing this issue, thank you for your time!

PatrikTheDev commented 3 years ago
image image image

I don't see it anywhere but I may have just misread. Please correct me if I'm wrong

PatrikTheDev commented 3 years ago

Wait I see it now, I'm really sorry for wasting your time

johnno1962 commented 3 years ago

Never mind. It's a common question. It used to work for real devices but the sandbox on iOS 10 put paid to that. I've updated the README for HotReloading and added an informative message if you try to run it on a device.