johnno1962 / InjectionIII

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

ld: building for 'iOS', but linking in object file built for 'visionOS-simulator' #505

Closed xinix909 closed 4 months ago

xinix909 commented 4 months ago

I use InjectionIII for Vision Pro simulator。It does not work when I use Xcode 15.3 or 15.4, but worked for 15.2

Inject linking failed message: ld: building for 'iOS', but linking in object file (/private/tmp/injection.o) built for 'visionOS-simulator' clang: error: linker command failed with exit code 1

command.sh content: "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -arch "arm64" -Xlinker -dylib -isysroot "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk" -L"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos" -miphoneos-version-min=9.0 -undefined dynamic_lookup -dead_strip -Xlinker -objc_abi_version -Xlinker 2 -Xlinker -interposable -fobjc-arc -fprofile-instr-generate "/tmp/injection.o" -L "/Users/xinix/Library/Developer/CoreSimulator/Devices/B62E7DBF-B491-45A7-BFC7-6C26507ED127/data/Containers/Data/Application/B3163D8B-3B0D-473C-8A66-DD409B543BC1/tmp/" -F "/Users/xinix/Library/Developer/CoreSimulator/Devices/B62E7DBF-B491-45A7-BFC7-6C26507ED127/data/Containers/Data/Application/B3163D8B-3B0D-473C-8A66-DD409B543BC1/tmp/" -rpath "/Users/xinix/Library/Developer/CoreSimulator/Devices/B62E7DBF-B491-45A7-BFC7-6C26507ED127/data/Containers/Data/Application/B3163D8B-3B0D-473C-8A66-DD409B543BC1/tmp/" -o "/Users/xinix/Library/Developer/CoreSimulator/Devices/B62E7DBF-B491-45A7-BFC7-6C26507ED127/data/Containers/Data/Application/B3163D8B-3B0D-473C-8A66-DD409B543BC1/tmp/eval102.dylib" >>"/Users/xinix/Library/Developer/CoreSimulator/Devices/B62E7DBF-B491-45A7-BFC7-6C26507ED127/data/Containers/Data/Application/B3163D8B-3B0D-473C-8A66-DD409B543BC1/tmp/eval102.log" 2>&1

xinix909 commented 4 months ago

only not work for objc

johnno1962 commented 4 months ago

Hi, switching between iOS and visionOS you need to clear out various caches. rm /tmp/iOS_build.plist and restart your app and the injection app.

johnno1962 commented 4 months ago

Hi, I've uploaded a new release candidate that should resolve this problem for you.

xinix909 commented 4 months ago

Hi, I've uploaded a new release candidate that should resolve this problem for you.

It works, thank you!

johnno1962 commented 4 months ago

👍