My app uses a couple of third-party dynamic libs, which I include in my app package. But what about the system libs that my own code and third-party libs depend on?
Examples include
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
/usr/lib/libSystem.B.dylib
Should I bundle these and update their reference paths in all caller binaries of the app package?
If I must, should I create app binaries for each macOS version?
My thinking is that I shouldn’t force my users to install Xcode, but I’m not sure if those system frameworks and dynamic libs are bundled with OS or installed through Xcode …
2
Answers
The system libs are guarantee to run on any system your application supports (and naturally they are installed on any Mac since the system itself uses them). Therefore, no, you don’t have to bundle these libs. Instead you have to carefully decide from which version of the OS your codes are prepared to support this or that version of a lib.
When a piece of code needs to be handled differently for different versions of the lib at runtime, you can use such form to synchronize your codes with the current environment :
You must not bundle these. Anything in
/System
or/usr/lib
is part of the operating system, not Xcode. They are not intended to be copied to other systems.