Closed axelthat closed 2 years ago
Hi, Does it work under Xcode? Can you post the contents of /Users/axel/Library/Developer/CoreSimulator/Devices/08177A3D-A71D-422E-A306-298729AD01C1/data/Containers/Data/Application/2C01F92B-C26B-495A-82A3-8B014D060F74/tmp/command.sh
I don't get any error on xcode. But the changes aren't reflected.
Edit: It suddenly started working on AppCode as well. But the changes are again not reflected.
Looks like the code to find AppCode's build logs has stopped working and it is using only Xcode's build data. Is this a new release of AppCode? @yeswolf? Changes not being reflected can be many things. Is viewDidLoad() called again when you inject? Do you have a @objc func injected()
method that calls it? The code needs to be actually called.
I am using the latest version of AppCode.
I am sorry I think I missed @objc fun injected()
. What should be the body of injected
function. Could you guide me? Thanks!
It's could call viewDidLoad() or something like configureView() which sets up the parameters you want to set.
Works perfectly. Thank you.
@johnno1962 The issue still exists in AppCode: π β οΈ Could not locate compile command for /Users/axel/MyApp/ViewController.swift.
.
I thought you said it was working in AppCode after you used Xcode? Which "the issue" is not working now?
It only works if xcode is in background running injection else it will not work stand-alone.
OK, thanks for letting me know. So, injection only works for you in AppCode if you are also running the iOS program inside Xcode at the same time? I've downloaded the new AppCode and am looking at it but can't get it to not work at the moment. The error you're getting at the moment is Could not locate compile command
right?
OK again, I may have found one problem. AppCode may be modifying source files in your home directory other than those of your project. To work around this until I get a fix out can you set the INJECTION_DRIECTORIES environment variable in your scheme to the project root directory to filter these changes out. This only applies to the "HotReloading" version of injection.
You're running the InjectionIII.app while you're trying to use Injection? What does it print when you load the iOSInjection.bundle? The AppCode support code seems to be working for me.
Is your machine M1 or Intel? I'm seeing some issues where the architecture gets confused as AppCode seems to be running as Intel as does your program in the simulator. This might take a while to sort out. It may be best to stick to Xcode for using injection on M1 for now.
OK, thanks for letting me know. So, injection only works for you in AppCode if you are also running the iOS program inside Xcode at the same time? I've downloaded the new AppCode and am looking at it but can't get it to not work at the moment. The error you're getting at the moment is Could not locate compile command right?
Yes, appcode only works when xcode is also running the app. And yes the error is "Could not locate compile command". Try changing a file inside appcode and you should be able to see the error.
You're running the InjectionIII.app while you're trying to use Injection? What does it print when you load the iOSInjection.bundle? The AppCode support code seems to be working for me.
Yes. And here's the message,
π InjectionIII connected /Users/axel/axop/Basket/Basket.xcodeproj
π Watching files under the directory /Users/axel/axop/Basket
Is your machine M1 or Intel? I'm seeing some issues where the architecture gets confused as AppCode seems to be running as Intel as does your program in the simulator. This might take a while to sort out. It may be best to stick to Xcode for using injection on M1 for now.
MacBook Pro (15-inch, 2018), 2.6 GHz 6-Core Intel Core i7.
Update,
Now, appcode works without xcode in background. I have no idea what changed. However, I do see this error. The hot reload still works despite this error.
objc[2096]: Class _TtC6Basket14ViewController is implemented in both /Users/axel/Library/Developer/CoreSimulator/Devices/08177A3D-A71D-422E-A306-298729AD01C1/data/Containers/Bundle/Application/AA8C07CD-B36F-4E8A-90FF-CC0BAB69EB41/Basket.app/Basket (0x101b41cc0) and /Users/axel/Library/Developer/CoreSimulator/Devices/08177A3D-A71D-422E-A306-298729AD01C1/data/Containers/Data/Application/A6B4BA46-2994-4F7E-8671-F6B1808A930A/tmp/eval101.dylib (0x104743308). One of the two will be used. Which one is undefined.
You don't need to worry about that message, it's just a warning I can't do anything about. If you're using Intel AppCode should still be working though it seems to be getting confused about which build logs to use when switching between Xcode and AppCode causing the Could not locate compile command
error. The code could be simplified a bit. It should work if you build clean and exit Xcode then build clean in AppCode and then relaunch.
Gotcha. Thank you so much. That solves my issue.
I am using injection on my new ios(13.0+) app without storyboards (not swiftui).
AppDelegate.swift
AppCode: 2022.1.2 XCode: 13.2 Injection: 4.2.7