Is using dlopen()/dlsym() allowed in iOS Projects ?

Hi,

If I have dynamic libraries like testlib.dylib, and I use it in my C++ code using dlopen(), dysym() etc, will it be allowed? This C++ code would be accessed via an Objective-C bridge from Swift. I read somewhere that if any app uses these in their code, it would be allowed to be pushlished on App Store, hence wanted to check the same.

Regards,

Abhishek

To start, be aware that I work for DTS, not App Review, and that only App Review can give you definitive answers about what will or won’t be allowed on the App Store.

Having said that, as far as I know, there’s no blanket prohibition against using

dlopen
and friends.

If I have dynamic libraries like

testlib.dylib

What platform are you working on? iOS-based platforms do not allow you to ship a ‘*****’ dynamic library [1]. You must wrap it in a framework.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

[1] Other than the Swift runtime libraries.

In addition to what @eskimo said, why are you looking to use dlopen instead of letting the system handle the linkage at launch? That's the preferred approach.

That’s the preferred approach.

Yeah, I shoulda mentioned that )-: One key benefit of declaring your imports is that the dynamic linker uses those declarations to form a closure [1] containing all the libraries you depend on, which significantly improves your launch performance. Libraries you load using

dlopen
can’t be included in that closure, and thus always load more slowly.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

[1] Not in the Swift sense of that word.

Is using dlopen()/dlsym() allowed in iOS Projects ?
 
 
Q