dylib: file system sandbox blocked mmap()

Is there a way to load dylib in debug environment?

Is there a way to load dylib in debug environment?

Can you expand on your requirements here? It is possible to load a dylib using

dlopen
on iOS, even in a production environment, as follows:
  1. Wrap it in a framework.

  2. Include that framework in your app’s Frameworks directory.

I presume that this doesn’t meet your requirements, in which case it’d be helpful if you explained those requirements in more detail.

Share and Enjoy

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

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

Thank you for reply.


I am trying a develop tool to hot reload changed code without rebuilding, that will download a dylib to document path and load it by "dlopen".

And simulator is ok.

I know it works if a put the dylib into app self. But now the dylib path is document, and it is blocked.

So...how should i do?


Thand you.

I am trying a develop tool to hot reload changed code without rebuilding

Doing this by loading a dylib on iOS isn’t feasible. The iOS sandbox prevents you from loading code in this way, even on development-signed processes (those with the

get-task-allow
entitlement).

About the only way forward I can see is to compile the code to LLVR IR and then interpret it.

Share and Enjoy

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

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

Thank you again.

We also have the same issue. This used to work in iOS 9, and was blocked in iOS 10+. Can we have a mode or entitlement that removes the code blocking mmap from an alternate folder? There are many titles that need to hotload C++ dylibs during development, and this restriction totally kills that. Our min-spec can't move off iOS 9 until this issue is addressed. Swift supports hotloading now, so this really can't be an Apple only feature.
dylib: file system sandbox blocked mmap()
 
 
Q