Share and install .dylib file to users on macOS App Store?

Viewed 161

I am new to macOS app development. I have knowledge on Windows App development. I have a server application which can be installed offline. For communicating there is a client library which is a .dylib. I want to distribute the .dylib using macOS App Store so that third party application can consume the library.

How to install the .dylib and headers to a location from macOS App Store as a installer?

3 Answers

You cannot distribute dynamic libraries and header files through the App Store. It's for applications only.

Instead, have a look at other means of distributing libraries such as CocoaPods, XCFrameworks etc.

Mac App Store is quite restrictive when it comes to installers. Usually you would distribute an .app that can be run directly and the app then installs more things if needed.

What kind of apps would consume your library? Why not provide a "Framework Bundle"?

This is the typical way to distribute libraries within macOS

How to install the .dylib and headers to a location from macOS App Store as a installer?

You don't. I'm afraid the App Store is not a package manager.

While you can put libraries, CLI binaries and other resources inside a GUI app bundle, you cannot distribute anything other than a GUI app bundle via the App Store. And neither could 3rd parties mark their app as "depending" on your app. And if they linked against a dylib outside of their app path, then it's highly likely that the app would get rejected in review because it would be found to not work. Again, it's not a package manager.

All apps on the App Store are required to be self-contained, so the way Apple wants developers to handle dependencies is by bundling a separate copy.

Thus, the only "supported" way to distribute your library in a way that can be used on the App Store is to make it available for download on your website, and then have each developer bundle a copy of it when they ship their app.

Of course you could opt for other (or additional) channels like brew, which are actual package managers, but that won't help with anything on the App Store.

Related