Closed mxi closed 2 months ago
Hi, have you set a default with the path to your project and the EXPANDED_CODESIGNING_IDENTITY? i.e. add a build phase:
defaults write com.johnholdsworth.InjectionIII "$PROJECT_FILE_PATH" "$EXPANDED_CODE_SIGN_IDENTITY"
Yes,
$ defaults read com.johnholdsworth.InjectionIII
{
"/Users/maxim/src/Notebook/Notebook.xcodeproj" = F693D2C0DBAEE406D1F3960174BDAD280A6CA223;
NSNavLastRootDirectory = "~/src/Notebook";
NSNavPanelExpandedSizeForOpenMode = "{800, 448}";
"NSWindow Frame GoToSheet" = "526 506 460 208 0 0 1512 944 ";
"NSWindow Frame NSNavPanelAutosaveName" = "356 372 800 448 0 0 1512 944 ";
deviceInform = Informed;
deviceUnlock = any;
lastProject = "/Users/maxim/src/Notebook/Notebook.xcodeproj";
lastWatched = "/Users/maxim/src/Notebook";
persistentBookmarks = {
"/Users/maxim/src/Notebook" = {length = 688, bytes = 0x626f6f6b b0020000 00000410 30000000 ... 04000000 00000000 };
"/Users/maxim/src/Notebook/Notebook" = {length = 712, bytes = 0x626f6f6b c8020000 00000410 30000000 ... 04000000 00000000 };
};
}
which matches the identity in the environment variables in the build logs:
+ codesign -f --sign F693D2C0DBAEE406D1F3960174BDAD280A6CA223 --timestamp=none --preserve-metadata=identifier,entitlements,flags --generate-entitlement-der /Users/maxim/Library/Developer/Xcode/DerivedData/Notebook-fvdbroycazvynoaeyiritcvmctew/Build/Products/Debug-iphoneos/Notebook.app/iOSInjection.bundle/Frameworks/XCTAutomationSupport.framework /Users/maxim/Library/Developer/Xcode/DerivedData/Notebook-fvdbroycazvynoaeyiritcvmctew/Build/Products/Debug-iphoneos/Notebook.app/iOSInjection.bundle/Frameworks/XCTest.framework /Users/maxim/Library/Developer/Xcode/DerivedData/Notebook-fvdbroycazvynoaeyiritcvmctew/Build/Products/Debug-iphoneos/Notebook.app/iOSInjection.bundle/Frameworks/XCTestCore.framework /Users/maxim/Library/Developer/Xcode/DerivedData/Notebook-fvdbroycazvynoaeyiritcvmctew/Build/Products/Debug-iphoneos/Notebook.app/iOSInjection.bundle/Frameworks/XCTestSupport.framework /Users/maxim/Library/Developer/Xcode/DerivedData/Notebook-fvdbroycazvynoaeyiritcvmctew/Build/Products/Debug-iphoneos/Notebook.app/iOSInjection.bundle/Frameworks/XCUIAutomation.framework /Users/maxim/Library/Developer/Xcode/DerivedData/Notebook-fvdbroycazvynoaeyiritcvmctew/Build/Products/Debug-iphoneos/Notebook.app/iOSInjection.bundle/Frameworks/XCUnit.framework /Users/maxim/Library/Developer/Xcode/DerivedData/Notebook-fvdbroycazvynoaeyiritcvmctew/Build/Products/Debug-iphoneos/Notebook.app/iOSInjection.bundle/Frameworks/libXCTestBundleInject.dylib /Users/maxim/Library/Developer/Xcode/DerivedData/Notebook-fvdbroycazvynoaeyiritcvmctew/Build/Products/Debug-iphoneos/Notebook.app/iOSInjection.bundle/Frameworks/libXCTestSwiftSupport.dylib
But also, I noticed that your copy_bundle.sh
script already sets that, no?
This is a mystery indeed. If you run the app fro the command line it will tell you when it is using a code signing identity. It seems like it's not code signing at all which would be unusual for a real device. Which exact version of InjectionIII is this?
I'm running versions from your github releases. (I should note I'm using Xcode 15.2).
Here is the log for 4.8.3 which was the last one with Xcode 15.2 noted:
2024-07-12 13:10:55.841 InjectionIII[11371:4094280] InjectionIII.DeviceServer: Multicast recvfrom localhost (192.168.0.48) 1104037719 c.f. 1104037719
2024-07-12 13:10:56.235 InjectionIII[11371:4094281] Connection from 192.168.0.48:57017
2024-07-12 13:10:56.236 InjectionIII[11371:4094590] đ InjectionIII Connection for project file: /Users/maxim/src/Notebook/Notebook.xcodeproj
2024-07-12 13:10:56.242 InjectionIII[11371:4094590] đ InjectionIII Using tmp dir: /var/folders/ds/112mkzld6g92cqxrtsth7qjc0000gn/T/
2024-07-12 13:11:02.150 InjectionIII[11371:4094269] đ InjectionIII evalError: Compiling /Users/maxim/src/Notebook/Notebook/View.m
2024-07-12 13:11:02.317 InjectionIII[11371:4094269] đ InjectionIII Signing with identity: F693D2C0DBAEE406D1F3960174BDAD280A6CA223
2024-07-12 13:11:02.447 InjectionIII[11371:4094590] đ InjectionIII Injection error: Error Domain=SwiftEval Code=-1 "dlopen() error: dlopen(/private/var/mobile/Containers/Data/Application/E64EA790-0917-4EB9-BDE5-5DFCBF2BFA1A/tmp/eval101.dylib, 0x0002): tried: '/usr/lib/system/introspection/eval101.dylib' (no such file, not in dyld cache), '/private/var/mobile/Containers/Data/Application/E64EA790-0917-4EB9-BDE5-5DFCBF2BFA1A/tmp/eval101.dylib' (code signature invalid in <08AD0C22-1132-3E51-984F-59453E6D9611> '/private/var/mobile/Containers/Data/Application/E64EA790-0917-4EB9-BDE5-5DFCBF2BFA1A/tmp/eval101.dylib' (errno=1) sliceOffset=0x00000000, codeBlobOffset=0x00020180, codeBlobSize=0x00004F40), '/private/preboot/Cryptexes/OS/private/var/mobile/Containers/Data/Application/E64EA790-0917-4EB9-BDE5-5DFCBF2BFA1A/tmp/eval101.dylib' (no such file), '/private/var/mobile/Containers/Data/Application/E64EA790-0917-4EB9-BDE5-5DFCBF2BFA1A/tmp/eval101.dylib' (code signature invalid in <08AD0C22-1132-3E51-984F-59453E6D9611> '/private/var/mobile/Containers/Data/Application/E64EA790-0917-4EB9-BDE5-5DFCBF2BFA1A/tmp/eval101.dylib' (errno=1) sliceOffset=0x00000000, codeBlobOffset=0x00020180, codeBlobSize=0x00004F40)
đ â ī¸ Loading .dylib has failed due to invalid code signing.
đ Add the following as a Run Script/Build Phase:
defaults write com.johnholdsworth.InjectionIII "$PROJECT_FILE_PATH" "$EXPANDED_CODE_SIGN_IDENTITY"" UserInfo={NSLocalizedDescription=dlopen() error: dlopen(/private/var/mobile/Containers/Data/Application/E64EA790-0917-4EB9-BDE5-5DFCBF2BFA1A/tmp/eval101.dylib, 0x0002): tried: '/usr/lib/system/introspection/eval101.dylib' (no such file, not in dyld cache), '/private/var/mobile/Containers/Data/Application/E64EA790-0917-4EB9-BDE5-5DFCBF2BFA1A/tmp/eval101.dylib' (code signature invalid in <08AD0C22-1132-3E51-984F-59453E6D9611> '/private/var/mobile/Containers/Data/Application/E64EA790-0917-4EB9-BDE5-5DFCBF2BFA1A/tmp/eval101.dylib' (errno=1) sliceOffset=0x00000000, codeBlobOffset=0x00020180, codeBlobSize=0x00004F40), '/private/preboot/Cryptexes/OS/private/var/mobile/Containers/Data/Application/E64EA790-0917-4EB9-BDE5-5DFCBF2BFA1A/tmp/eval101.dylib' (no such file), '/private/var/mobile/Containers/Data/Application/E64EA790-0917-4EB9-BDE5-5DFCBF2BFA1A/tmp/eval101.dylib' (code signature invalid in <08AD0C22-1132-3E51-984F-59453E6D9611> '/private/var/mobile/Containers/Data/Application/E64EA790-0917-4EB9-BDE5-5DFCBF2BFA1A/tmp/eval101.dylib' (errno=1) sliceOffset=0x00000000, codeBlobOffset=0x00020180, codeBlobSize=0x00004F40)
đ â ī¸ Loading .dylib has failed due to invalid code signing.
đ Add the following as a Run Script/Build Phase:
defaults write com.johnholdsworth.InjectionIII "$PROJECT_FILE_PATH" "$EXPANDED_CODE_SIGN_IDENTITY"}
2024-07-12 13:11:02.549 InjectionIII[11371:4094723] đ InjectionIII evalError: Compiling /Users/maxim/src/Notebook/Notebook/View.m
2024-07-12 13:11:02.670 InjectionIII[11371:4094723] đ InjectionIII Signing with identity: F693D2C0DBAEE406D1F3960174BDAD280A6CA223
2024-07-12 13:11:02.834 InjectionIII[11371:4094590] đ InjectionIII Injection error: Error Domain=SwiftEval Code=-1 "dlopen() error: dlopen(/private/var/mobile/Containers/Data/Application/E64EA790-0917-4EB9-BDE5-5DFCBF2BFA1A/tmp/eval102.dylib, 0x0002): tried: '/usr/lib/system/introspection/eval102.dylib' (no such file, not in dyld cache), '/private/var/mobile/Containers/Data/Application/E64EA790-0917-4EB9-BDE5-5DFCBF2BFA1A/tmp/eval102.dylib' (code signature invalid in <499AA054-C697-3DFE-A726-375B47A0FEB0> '/private/var/mobile/Containers/Data/Application/E64EA790-0917-4EB9-BDE5-5DFCBF2BFA1A/tmp/eval102.dylib' (errno=1) sliceOffset=0x00000000, codeBlobOffset=0x00020180, codeBlobSize=0x00004F40), '/private/preboot/Cryptexes/OS/private/var/mobile/Containers/Data/Application/E64EA790-0917-4EB9-BDE5-5DFCBF2BFA1A/tmp/eval102.dylib' (no such file), '/private/var/mobile/Containers/Data/Application/E64EA790-0917-4EB9-BDE5-5DFCBF2BFA1A/tmp/eval102.dylib' (code signature invalid in <499AA054-C697-3DFE-A726-375B47A0FEB0> '/private/var/mobile/Containers/Data/Application/E64EA790-0917-4EB9-BDE5-5DFCBF2BFA1A/tmp/eval102.dylib' (errno=1) sliceOffset=0x00000000, codeBlobOffset=0x00020180, codeBlobSize=0x00004F40)
đ â ī¸ Loading .dylib has failed due to invalid code signing.
đ Add the following as a Run Script/Build Phase:
defaults write com.johnholdsworth.InjectionIII "$PROJECT_FILE_PATH" "$EXPANDED_CODE_SIGN_IDENTITY"" UserInfo={NSLocalizedDescription=dlopen() error: dlopen(/private/var/mobile/Containers/Data/Application/E64EA790-0917-4EB9-BDE5-5DFCBF2BFA1A/tmp/eval102.dylib, 0x0002): tried: '/usr/lib/system/introspection/eval102.dylib' (no such file, not in dyld cache), '/private/var/mobile/Containers/Data/Application/E64EA790-0917-4EB9-BDE5-5DFCBF2BFA1A/tmp/eval102.dylib' (code signature invalid in <499AA054-C697-3DFE-A726-375B47A0FEB0> '/private/var/mobile/Containers/Data/Application/E64EA790-0917-4EB9-BDE5-5DFCBF2BFA1A/tmp/eval102.dylib' (errno=1) sliceOffset=0x00000000, codeBlobOffset=0x00020180, codeBlobSize=0x00004F40), '/private/preboot/Cryptexes/OS/private/var/mobile/Containers/Data/Application/E64EA790-0917-4EB9-BDE5-5DFCBF2BFA1A/tmp/eval102.dylib' (no such file), '/private/var/mobile/Containers/Data/Application/E64EA790-0917-4EB9-BDE5-5DFCBF2BFA1A/tmp/eval102.dylib' (code signature invalid in <499AA054-C697-3DFE-A726-375B47A0FEB0> '/private/var/mobile/Containers/Data/Application/E64EA790-0917-4EB9-BDE5-5DFCBF2BFA1A/tmp/eval102.dylib' (errno=1) sliceOffset=0x00000000, codeBlobOffset=0x00020180, codeBlobSize=0x00004F40)
đ â ī¸ Loading .dylib has failed due to invalid code signing.
đ Add the following as a Run Script/Build Phase:
defaults write com.johnholdsworth.InjectionIII "$PROJECT_FILE_PATH" "$EXPANDED_CODE_SIGN_IDENTITY"}
2024-07-12 13:11:07.040 InjectionIII[11371:4094723] đ InjectionIII evalError: Compiling /Users/maxim/src/Notebook/Notebook/View.m
2024-07-12 13:11:07.202 InjectionIII[11371:4094723] đ InjectionIII Signing with identity: F693D2C0DBAEE406D1F3960174BDAD280A6CA223
2024-07-12 13:11:07.641 InjectionIII[11371:4094590] đ InjectionIII <InjectionIII.DeviceServer: 0x600002384700>.deinit()
Here is 5.0.1 with a bork at the end which I'm assuming is due to Xcode version mismatch:
2024-07-12 13:15:33.347 InjectionIII[11549:4097943] InjectionIII.DeviceServer: Multicast recvfrom localhost (192.168.0.48) 1104037719 c.f. 1104037719
2024-07-12 13:15:34.019 InjectionIII[11549:4097944] Connection from 192.168.0.48:57098
2024-07-12 13:15:34.022 InjectionIII[11549:4098514] đ InjectionIII Connection for project file: /Users/maxim/src/Notebook/Notebook.xcodeproj
2024-07-12 13:15:34.125 InjectionIII[11549:4098514] đ InjectionIII Using tmp dir: /var/folders/ds/112mkzld6g92cqxrtsth7qjc0000gn/T/
2024-07-12 13:15:40.605 InjectionIII[11549:4098525] đ InjectionIII evalError: Compiling /Users/maxim/src/Notebook/Notebook/View.m
2024-07-12 13:15:40.771 InjectionIII[11549:4098525] đ InjectionIII Signing with identity: F693D2C0DBAEE406D1F3960174BDAD280A6CA223
2024-07-12 13:15:41.017 InjectionIII[11549:4098514] đ InjectionIII Injection error: Error Domain=SwiftEval Code=-1 "dlopen() error: dlopen(/private/var/mobile/Containers/Data/Application/1086A04A-BD77-4092-854A-7A6CFAA68DF9/tmp/eval101.dylib, 0x0002): tried: '/usr/lib/system/introspection/eval101.dylib' (no such file, not in dyld cache), '/private/var/mobile/Containers/Data/Application/1086A04A-BD77-4092-854A-7A6CFAA68DF9/tmp/eval101.dylib' (code signature invalid in <03895B34-24FF-38CB-952B-12C6081B737D> '/private/var/mobile/Containers/Data/Application/1086A04A-BD77-4092-854A-7A6CFAA68DF9/tmp/eval101.dylib' (errno=1) sliceOffset=0x00000000, codeBlobOffset=0x00020180, codeBlobSize=0x00004F40), '/private/preboot/Cryptexes/OS/private/var/mobile/Containers/Data/Application/1086A04A-BD77-4092-854A-7A6CFAA68DF9/tmp/eval101.dylib' (no such file), '/private/var/mobile/Containers/Data/Application/1086A04A-BD77-4092-854A-7A6CFAA68DF9/tmp/eval101.dylib' (code signature invalid in <03895B34-24FF-38CB-952B-12C6081B737D> '/private/var/mobile/Containers/Data/Application/1086A04A-BD77-4092-854A-7A6CFAA68DF9/tmp/eval101.dylib' (errno=1) sliceOffset=0x00000000, codeBlobOffset=0x00020180, codeBlobSize=0x00004F40)
đ â ī¸ Loading .dylib has failed due to invalid code signing.
đ Add the following as a Run Script/Build Phase:
defaults write com.johnholdsworth.InjectionIII "$PROJECT_FILE_PATH" "$EXPANDED_CODE_SIGN_IDENTITY"" UserInfo={NSLocalizedDescription=dlopen() error: dlopen(/private/var/mobile/Containers/Data/Application/1086A04A-BD77-4092-854A-7A6CFAA68DF9/tmp/eval101.dylib, 0x0002): tried: '/usr/lib/system/introspection/eval101.dylib' (no such file, not in dyld cache), '/private/var/mobile/Containers/Data/Application/1086A04A-BD77-4092-854A-7A6CFAA68DF9/tmp/eval101.dylib' (code signature invalid in <03895B34-24FF-38CB-952B-12C6081B737D> '/private/var/mobile/Containers/Data/Application/1086A04A-BD77-4092-854A-7A6CFAA68DF9/tmp/eval101.dylib' (errno=1) sliceOffset=0x00000000, codeBlobOffset=0x00020180, codeBlobSize=0x00004F40), '/private/preboot/Cryptexes/OS/private/var/mobile/Containers/Data/Application/1086A04A-BD77-4092-854A-7A6CFAA68DF9/tmp/eval101.dylib' (no such file), '/private/var/mobile/Containers/Data/Application/1086A04A-BD77-4092-854A-7A6CFAA68DF9/tmp/eval101.dylib' (code signature invalid in <03895B34-24FF-38CB-952B-12C6081B737D> '/private/var/mobile/Containers/Data/Application/1086A04A-BD77-4092-854A-7A6CFAA68DF9/tmp/eval101.dylib' (errno=1) sliceOffset=0x00000000, codeBlobOffset=0x00020180, codeBlobSize=0x00004F40)
đ â ī¸ Loading .dylib has failed due to invalid code signing.
đ Add the following as a Run Script/Build Phase:
defaults write com.johnholdsworth.InjectionIII "$PROJECT_FILE_PATH" "$EXPANDED_CODE_SIGN_IDENTITY"}
2024-07-12 13:15:41.159 InjectionIII[11549:4098603] đ InjectionIII evalError: Compiling /Users/maxim/src/Notebook/Notebook/View.m
2024-07-12 13:15:41.278 InjectionIII[11549:4098603] đ InjectionIII Signing with identity: F693D2C0DBAEE406D1F3960174BDAD280A6CA223
2024-07-12 13:15:41.465 InjectionIII[11549:4098514] đ InjectionIII Injection error: Error Domain=SwiftEval Code=-1 "dlopen() error: dlopen(/private/var/mobile/Containers/Data/Application/1086A04A-BD77-4092-854A-7A6CFAA68DF9/tmp/eval102.dylib, 0x0002): tried: '/usr/lib/system/introspection/eval102.dylib' (no such file, not in dyld cache), '/private/var/mobile/Containers/Data/Application/1086A04A-BD77-4092-854A-7A6CFAA68DF9/tmp/eval102.dylib' (code signature invalid in <FAD00212-13C2-3254-9F17-6ECD8898473C> '/private/var/mobile/Containers/Data/Application/1086A04A-BD77-4092-854A-7A6CFAA68DF9/tmp/eval102.dylib' (errno=1) sliceOffset=0x00000000, codeBlobOffset=0x00020180, codeBlobSize=0x00004F40), '/private/preboot/Cryptexes/OS/private/var/mobile/Containers/Data/Application/1086A04A-BD77-4092-854A-7A6CFAA68DF9/tmp/eval102.dylib' (no such file), '/private/var/mobile/Containers/Data/Application/1086A04A-BD77-4092-854A-7A6CFAA68DF9/tmp/eval102.dylib' (code signature invalid in <FAD00212-13C2-3254-9F17-6ECD8898473C> '/private/var/mobile/Containers/Data/Application/1086A04A-BD77-4092-854A-7A6CFAA68DF9/tmp/eval102.dylib' (errno=1) sliceOffset=0x00000000, codeBlobOffset=0x00020180, codeBlobSize=0x00004F40)
đ â ī¸ Loading .dylib has failed due to invalid code signing.
đ Add the following as a Run Script/Build Phase:
defaults write com.johnholdsworth.InjectionIII "$PROJECT_FILE_PATH" "$EXPANDED_CODE_SIGN_IDENTITY"" UserInfo={NSLocalizedDescription=dlopen() error: dlopen(/private/var/mobile/Containers/Data/Application/1086A04A-BD77-4092-854A-7A6CFAA68DF9/tmp/eval102.dylib, 0x0002): tried: '/usr/lib/system/introspection/eval102.dylib' (no such file, not in dyld cache), '/private/var/mobile/Containers/Data/Application/1086A04A-BD77-4092-854A-7A6CFAA68DF9/tmp/eval102.dylib' (code signature invalid in <FAD00212-13C2-3254-9F17-6ECD8898473C> '/private/var/mobile/Containers/Data/Application/1086A04A-BD77-4092-854A-7A6CFAA68DF9/tmp/eval102.dylib' (errno=1) sliceOffset=0x00000000, codeBlobOffset=0x00020180, codeBlobSize=0x00004F40), '/private/preboot/Cryptexes/OS/private/var/mobile/Containers/Data/Application/1086A04A-BD77-4092-854A-7A6CFAA68DF9/tmp/eval102.dylib' (no such file), '/private/var/mobile/Containers/Data/Application/1086A04A-BD77-4092-854A-7A6CFAA68DF9/tmp/eval102.dylib' (code signature invalid in <FAD00212-13C2-3254-9F17-6ECD8898473C> '/private/var/mobile/Containers/Data/Application/1086A04A-BD77-4092-854A-7A6CFAA68DF9/tmp/eval102.dylib' (errno=1) sliceOffset=0x00000000, codeBlobOffset=0x00020180, codeBlobSize=0x00004F40)
đ â ī¸ Loading .dylib has failed due to invalid code signing.
đ Add the following as a Run Script/Build Phase:
defaults write com.johnholdsworth.InjectionIII "$PROJECT_FILE_PATH" "$EXPANDED_CODE_SIGN_IDENTITY"}
2024-07-12 13:15:45.021 InjectionIII[11549:4098514] [<InjectionIII.DeviceServer: 0x600002778580> readInt:0x16bd669dc length:4] error: 0 No such file or directory
2024-07-12 13:15:45.022 InjectionIII[11549:4098514] đ InjectionIII <InjectionIII.DeviceServer: 0x600002778580>.deinit()
This is a very strange problem as the app seems to be doing all the right things. It may be worth you switching to the new implementation https://github.com/johnno1962/InjectionNext which is simpler and easier to debug than InjectionIII. It is largely the same except there is a smaller client which is always a Swift package and you need to use the MacOS app to launch Xcode so it can parse how to compile the files. When connecting from a device you use the "Enable devices" menu item which allows you to enter the code signing identity directly.
Hmm, so I tried InjectionNext (5.0.11 from github releases) and I get this,
2024-07-12 15:16:54.794 InjectionNext[14103:4154042] Invalid color System, textInsertionPointColor (warning given only once)
2024-07-12 15:16:57.719 InjectionNext[14103:4154044] DLKit: Unable to find replacement for symbol: $s7Fortify21hook_assertionFailure__4file4line5flagss5NeverOs12StaticStringV_A2ISus6UInt32VtF
2024-07-12 15:16:57.720 InjectionNext[14103:4154044] DLKit: Unable to find replacement for symbol: $s7Fortify21hook_assertionFailure__4file4line5flagss5NeverOs12StaticStringV_SSAISus6UInt32VtF
2024-07-12 15:16:57.720 InjectionNext[14103:4154044] DLKit: missing replacement at index 0 for symbol $ss17_assertionFailure__4file4line5flagss5NeverOs12StaticStringV_A2HSus6UInt32VtF
2024-07-12 15:16:57.720 InjectionNext[14103:4154044] DLKit: missing replacement at index 1 for symbol $ss17_assertionFailure__4file4line5flagss5NeverOs12StaticStringV_SSAHSus6UInt32VtF
2024-07-12 15:16:57.721 InjectionNext[14103:4154044] DLKit: No symbols replaced, have you added -Xlinker -interposable to your project's "Other Linker Flags"?
2024-07-12 15:16:57.721 InjectionNext[14103:4154044] â ī¸ Unable to hook _assertionFailure
Updating 131 args with 0 swift files /Users/maxim/src/Notebook/Notebook/main.m key.compilerargs: [
Injecting saved file /Users/maxim/src/Notebook/Notebook/main.m
đĨ Recompiling: /Users/maxim/src/Notebook/Notebook/main.m
2024-07-12 15:17:33.983 InjectionNext[14103:4154987] â ī¸ Linking failed:
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -arch "arm64" -Xlinker -dylib -isysroot "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk" -L"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx" -mmacosx-version-min=10.11 -undefined dynamic_lookup -dead_strip -Xlinker -objc_abi_version -Xlinker 2 -Xlinker -interposable -fobjc-arc -fprofile-instr-generate /tmp/injectionNext_0.o -L "/Users/maxim/Applications/InjectionNext.app/Contents/Frameworks" -F "/Users/maxim/Applications/InjectionNext.app/Contents/Frameworks" -rpath "/Users/maxim/Applications/InjectionNext.app/Contents/Frameworks" -o "/tmp/compilertron_patches/eval_injection_main_1.dylib" -rpath /usr/lib/swift -rpath "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.5/macosx"
errors:
ld: warning: search path '/Users/maxim/Applications/InjectionNext.app/Contents/Frameworks' not found
ld: warning: search path '/Users/maxim/Applications/InjectionNext.app/Contents/Frameworks' not found
ld: building for 'macOS', but linking in object file (/private/tmp/injectionNext_0.o) built for 'iOS'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
đĨ â ī¸ Linking failed:
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -arch "arm64" -Xlinker -dylib -isysroot "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk" -L"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx" -mmacosx-version-min=10.11 -undefined dynamic_lookup -dead_strip -Xlinker -objc_abi_version -Xlinker 2 -Xlinker -interposable -fobjc-arc -fprofile-instr-generate /tmp/injectionNext_0.o -L "/Users/maxim/Applications/InjectionNext.app/Contents/Frameworks" -F "/Users/maxim/Applications/InjectionNext.app/Contents/Frameworks" -rpath "/Users/maxim/Applications/InjectionNext.app/Contents/Frameworks" -o "/tmp/compilertron_patches/eval_injection_main_1.dylib" -rpath /usr/lib/swift -rpath "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.5/macosx"
errors:
ld: warning: search path '/Users/maxim/Applications/InjectionNext.app/Contents/Frameworks' not found
ld: warning: search path '/Users/maxim/Applications/InjectionNext.app/Contents/Frameworks' not found
ld: building for 'macOS', but linking in object file (/private/tmp/injectionNext_0.o) built for 'iOS'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
2024-07-12 15:17:33.983 InjectionNext[14103:4154987] â ī¸ Injection failed.
đĨ â ī¸ Injection failed.
Interestingly it thinks -Xlinker -interposable
aren't specified even tho they appear on the commandline...
But did you add the InjectionNext Swift package to your app? Is your app even connecting to the InjectionNext.app? The log you've posted is not showing that. Don't worry about the warning for -interposable for Objective-C as it is not required. Besides, the file you're injecting can't be injected as it is not a class.
On second thoughts, if you're seeing the message âšī¸ No symbols replaced, have you added -Xlinker -interposable to your project's Debug configuration "Other Linker Flags"?
this means you're connected, code signing is working and have injected but the file you're injecting (main.m?) does not contain any symbols that can inject. The messages you report from the console are just noise from when you save a file and are not connected that you would not normally see.
It appears to be a similar issue to https://github.com/johnno1962/InjectionNext/issues/2 because in the Xcode console
đĨ InjectionNext: Locating developer's Mac. Have you selected "Enable Devices"?
Broadcasting to en0.4:192.168.0.255 to locate InjectionNext host...
Broadcasting to en2.8:169.254.255.255 to locate InjectionNext host...
so it's actually not connecting? Here is my netstat -an
17:tcp4 0 0 *.8887 *.* LISTEN
306:udp4 0 0 *.8887 *.*
which seems to be fine.
If I look at the error log from the dropdown menu,
ld: warning: search path '/Applications/InjectionNext.app/Contents/Frameworks' not found
ld: warning: search path '/Applications/InjectionNext.app/Contents/Frameworks' not found
ld: building for 'macOS', but linking in object file (/private/tmp/injectionNext_0.o) built for 'iOS'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
This was for 1.0.11 btw.
Ok, I tried compiling InjectionNext from source. I'm able to connect now just fine, but the code sign error rears its ugly head.
from Xcode console:
đĨ InjectionNext: Locating developer's Mac. Have you selected "Enable Devices"?
Broadcasting to en0.4:192.168.0.255 to locate InjectionNext host...
đĨ Connecting to eta.hsd1.ca.comcast.net (192.168.0.90)...
đĨ InjectionNext: iPhoneOS connection to app established, waiting for commands.
đĨ Platform connected: iPhoneOS
đĨ Recompiling: /Users/maxim/src/Notebook/Notebook/View.m
đĨ â ī¸ dlopen failed dlopen(/private/var/mobile/Containers/Data/Application/1D245AC0-0BEF-4964-A9CE-1C4DAD26391F/tmp//eval_injection_View_1.dylib, 0x0002): tried: '/usr/lib/system/introspection/eval_injection_View_1.dylib' (no such file, not in dyld cache), '/private/var/mobile/Containers/Data/Application/1D245AC0-0BEF-4964-A9CE-1C4DAD26391F/tmp//eval_injection_View_1.dylib' (code signature invalid in <3481CE70-447B-3750-B8D3-C584D8332285> '/private/var/mobile/Containers/Data/Application/1D245AC0-0BEF-4964-A9CE-1C4DAD26391F/tmp/eval_injection_View_1.dylib' (errno=1) sliceOffset=0x00000000, codeBlobOffset=0x0000C7F0, codeBlobSize=0x00004B60), '/private/preboot/Cryptexes/OS/private/var/mobile/Containers/Data/Application/1D245AC0-0BEF-4964-A9CE-1C4DAD26391F/tmp//eval_injection_View_1.dylib' (no such file), '/private/var/mobile/Containers/Data/Application/1D245AC0-0BEF-4964-A9CE-1C4DAD26391F/tmp//eval_injection_View_1.dylib' (code signature invalid in <3481CE70-447B-3750-B8D3-C584D8332285> '/private/var/mobile/Containers/Data/Application/1D245AC0-0BEF-4964-A9CE-1C4DAD26391F/tmp/eval_injection_View_1.dylib' (errno=1) sliceOffset=0x00000000, codeBlobOffset=0x0000C7F0, codeBlobSize=0x00004B60), '/usr/lib/system/introspection/eval_injection_View_1.dylib' (no such file, not in dyld cache), '/private/var/mobile/Containers/Data/Application/1D245AC0-0BEF-4964-A9CE-1C4DAD26391F/tmp/eval_injection_View_1.dylib' (code signature invalid in <3481CE70-447B-3750-B8D3-C584D8332285> '/private/var/mobile/Containers/Data/Application/1D245AC0-0BEF-4964-A9CE-1C4DAD26391F/tmp/eval_injection_View_1.dylib' (errno=1) sliceOffset=0x00000000, codeBlobOffset=0x0000C7F0, codeBlobSize=0x00004B60), '/private/preboot/Cryptexes/OS/private/var/mobile/Containers/Data/Application/1D245AC0-0BEF-4964-A9CE-1C4DAD26391F/tmp/eval_injection_View_1.dylib' (no such file), '/private/var/mobile/Containers/Data/Application/1D245AC0-0BEF-4964-A9CE-1C4DAD26391F/tmp/eval_injection_View_1.dylib' (code signature invalid in <3481CE70-447B-3750-B8D3-C584D8332285> '/private/var/mobile/Containers/Data/Application/1D245AC0-0BEF-4964-A9CE-1C4DAD26391F/tmp/eval_injection_View_1.dylib' (errno=1) sliceOffset=0x00000000, codeBlobOffset=0x0000C7F0, codeBlobSize=0x00004B60)
đĨ Injection failed to load. If this was due to a default argument. Select the app's menu item "Unhide Symbols".
đĨ â ī¸ packageFrameworks not set, view a Swift source.
From CLI:
2024-07-13 08:58:45.029 InjectionNext[17799:4234524] Invalid color System, textInsertionPointColor (warning given only once)
Updating 131 args with 0 swift files /Users/maxim/src/Notebook/Notebook/View.m key.compilerargs: [
Updating 131 args with 0 swift files /Users/maxim/src/Notebook/Notebook/View.m key.compilerargs: [
Updating 131 args with 0 swift files /Users/maxim/src/Notebook/Notebook/View.m key.compilerargs: [
2024-07-13 08:59:47.748 InjectionNext[17799:4234914] InjectionNext.InjectionServer: Multicast recvfrom localhost (192.168.0.48) 1104037719 c.f. 1104037719
2024-07-13 08:59:48.396 InjectionNext[17799:4234915] Connection from 192.168.0.48:60241
2024-07-13 08:59:48.398 InjectionNext[17799:4236311] đĨ InjectionNext Platform connected: iPhoneOS
Tmp path: /private/var/mobile/Containers/Data/Application/1D245AC0-0BEF-4964-A9CE-1C4DAD26391F/tmp/
Injecting saved file /Users/maxim/src/Notebook/Notebook/View.m
đĨ Recompiling: /Users/maxim/src/Notebook/Notebook/View.m
Prepared dylib: /tmp/eval_injection_View_1.dylib
2024-07-13 08:59:55.029 InjectionNext[17799:4236311] đĨ InjectionNext Injection failed to load. If this was due to a default argument. Select the app's menu item "Unhide Symbols".
2024-07-13 09:00:31.019 InjectionNext[17799:4234524] đĨ InjectionNext â ī¸ packageFrameworks not set, view a Swift source.
Injecting saved file /Users/maxim/src/Notebook/Notebook/View.m
đĨ Recompiling: /Users/maxim/src/Notebook/Notebook/View.m
Prepared dylib: /tmp/eval_injection_View_2.dylib
2024-07-13 09:00:37.828 InjectionNext[17799:4236311] đĨ InjectionNext Injection failed to load. If this was due to a default argument. Select the app's menu item "Unhide Symbols".
2024-07-13 09:01:39.058 InjectionNext[17799:4234524] đĨ InjectionNext â ī¸ packageFrameworks not set, view a Swift source.
I confirmed that I have the right extended code sign identity in the Enable Devices
drop down menu.
I've also tried defaults write com.johnholdsworth.InjectionNext signingidentity "${EXPANDED_CODE_SIGN_IDENTITY}"
(obviously with my code sign identity substituted) and it still doesn't seem to like it.
Have you tried a smaller example project with a different identity or is this the smaller example project? Have you tried a Swift project? Getting injection working on a device is an extra level of difficulty. Seems like it's something to do with InjectionNext accessing that specific identity though you'd expect to see an error.
I figure this is a rather small project already.
$ tree Notebook
Notebook
âââ AppDelegate.h
âââ AppDelegate.m
âââ Assets.xcassets
â  âââ AccentColor.colorset
â  â  âââ Contents.json
â  âââ AppIcon.appiconset
â  â  âââ Contents.json
â  âââ Contents.json
âââ Base.lproj
â  âââ LaunchScreen.storyboard
â  âââ Main.storyboard
âââ Info.plist
âââ SceneDelegate.h
âââ SceneDelegate.m
âââ View.h
âââ View.m
âââ ViewController.h
âââ ViewController.m
âââ main.m
Admittedly I probably should just continue working on it and learning iOS before trying hotloading, but my debug builds take ages to start on my device and having to wait upwards of 30 seconds to a minute when changing one parameter is a pain.
I'll try it on a Swift project and report back.
P.S. I tried adding another certificate through Xcode > Settings > Accounts > Manage Certificates > +, but I'm not sure if that's the right way to do it (it did change the expanded code sign identity which I've updated in InjectionNext to no success, but maybe I'm not doing it right.)
It's a provisioning issue. Code signing either "just works" or can give you a lot of trouble â Injecting on a device isn't exactly a "getting started in iOS" level task. Can you not use the simulator for now until you get a little more settled.
So I tried on a fresh template Swift project and same code sign issue.
I'll look into code signing a bit more, then. Thank you for your time, though.
OK, Good luck, you should find things a bit easier to follow with the new project. Welcome to the community!
I'll start by saying that I'm new to iOS development but not development in general.
I've tried to follow your instructions to get this working as best as my tired brain allowed, yet right at the last hurdle I can't seem to figure out what's going wrong. (Doesn't help that I'm not too familiar with code signing shenanigans...)
Anyways, here's the error I get when I change a source file:
Also, it seems like the warning message is outdated because
copy_bundle.sh
seems to already do thedefaults write
thing.Here's the build log as well. I hope there isn't much sensitive information. I omitted my
Signing Identity
at the very bottom just in case (I don't think it's needed anyways.)I'd appreciate your time if you decide to look into this. I know it's hard being an open source maintainer this day and age. Let me know if you need more information. Cheers.
Oh, I guess I'll also add, this is how my bundle initialization bit looks like