How to hook calls into libSystem for debugging

fishhook is a very simple library that enables dynamically rebinding symbols in Mach-O binaries running on iOS in the simulator and on device.

And why would you do this? Overriding function entry points with your own code can help track down unusual/intermittent bugs.