Modified Mono.Data.Sqlite OSX - Linking dylib

In our project we use Mono.Data.Sqlite for both Windows and OSX. However we are using a modified libsqlite3.dylib from the original one in the system. For windows it’s a piece of cake, you simply put the new dll in Plugins, but we are having problems with OSX.

The idea is to use this new .dylib instead of the one located in /usr/lib. The problem is that we don’t know where to put the modified dylib so that unity can use that instead. We have tried to replace the original lib in /usr/lib but it seems you can’t modify or delete any file in that folder location.

We are using Unity 5.3.3 with the latest OSX El capitan.

I found the answer for all of you wondering! In your release .app:

Show Contents-> Contents-> Data->Managed->etc->mono->config 

Open and change the dll map the line where the dll is sqlite3 to:

<dllmap dll="sqlite3" target="@executable_path/../Frameworks/MonoEmbedRuntime/osx/libsqlite3.0.dylib" os="!windows"/>

And put the dylib in Contents->Frameworks->MonoEmbedRuntime->osx