I'm trying to run an app that has a .dylib listed in the configuration of the application as "Embed & Sign"
I can confirm it is correctly signed by inspecting the package using codesign -dv --verbose=4 lib_paths.dylib
and it gives me the following:
Executable=/Users/blablabla/Debug-iphoneos/TestApp.app/Frameworks/lib_paths.dylib
Identifier=lib_paths
Format=Mach-O thin (arm64)
CodeDirectory v=20400 size=784 flags=0x0(none) hashes=16+5 location=embedded
VersionPlatform=2
VersionMin=917504
VersionSDK=1049600
Hash type=sha256 size=32
CandidateCDHash sha256=7eaecbb8e00114767c9de0ac9054213620052212
CandidateCDHashFull sha256=7eaecbb8e00114767c9de0ac90542136200522121105dd217b38bd27e1fda4de
Hash choices=sha256
CMSDigest=7eaecbb8e00114767c9de0ac90542136200522121105dd217b38bd27e1fda4de
CMSDigestType=2
Executable Segment base=0
Executable Segment limit=32768
Executable Segment flags=0x0
Page size=4096
Launch Constraints:
None
CDHash=7eaecbb8e00114767c9de0ac9054213620052212
Signature size=4795
Authority=Apple Development: myemail@address.com (XXXXXXXXX)
Authority=Apple Worldwide Developer Relations Certification Authority
Authority=Apple Root CA
Signed Time=13 Dec 2023 at 21:39:28
Info.plist=not bound
TeamIdentifier=XXXXXXXXXXX
Sealed Resources=none
Internal requirements count=1 size=180
But when trying to run the application, I am getting the following error:
Referenced from: '/private/var/containers/Bundle/Application/3142F1F2-547B-41B5-8EF4-239F4EAD2A4F/TestApp.app/FSVTestApp'
Reason: tried: '/usr/lib/system/introspection/lib_paths.dylib' (no such file),
'/usr/lib/swift/lib_paths.dylib' (no such file),
'/private/var/containers/Bundle/Application/3142F1F2-547B-41B5-8EF4-239F4EAD2A4F/TestApp.app/Frameworks/lib_paths.dylib' (code signature invalid (errno=1) sliceOffset=0x00000000, codeBlobOffset=0x0000C5E0, codeBlobSize=0x00004B50 for '/private/var/containers/Bundle/Application/3142F1F2-547B-41B5-8EF4-239F4EAD2A4F/TestApp.app/Frameworks/lib_paths.dylib'),
Note that I enabled the "Automatically manage signing" option, and using a Personal Team.
This seems to work fine for the application itself (otherwise it wouldnt even try to load the dylib).
What is going on ?