LD_PRELOAD on Mac OS X

02 Jun 2012

You want

DYLD_INSERT_LIBRARIES=/path/to/your.dyld command.
If that doesn't work, make sure the linker is finding your library by trying:

DYLD_PRINT_LIBRARIES=1 DYLD_INSERT_LIBRARIES=/path/to/your.dyld command.
Once you've confirmed that your library is being loaded, but it's still not working, try this

DYLD_FORCE_FLAT_NAMESPACE=1 DYLD_INSERT_LIBRARIES=/path/to/your.dyld command
man dyld is full of more details.



See also: