Missing library libSystem.B.dylib

Hello,

I am developing a tool in python or nodejs to intercept flows between two applications (MITM). I want to use the FRIDA library, but when I use it I get the following error: Error: module not found at "/usr/lib/libSystem.B.dylib".

Indeed, the library is not present in the folder. I tried to get help directly from FRIDA but I couldn't find any help and on the current forum I did see some posts talking about this problem but I couldn't solve it.

Do you have an idea of how to solve this problem. Thank you.

Ps: I'm new to the APPLE ecosystem (Mac mini - Apple M1)

Replies

We appreciate your interest in participating in the forums! These forums are for questions about developing software and accessories for Apple platforms. Your question seems related to a consumer feature and is better suited for the Apple Support Communities

Problems like this typically happen when folks try to link against the dynamic libraries built in to the system rather than the stub libraries in the macOS SDK. I talk about this concept in general in An Apple Library Primer, and if you search that post for “stub library” you’ll find a link to another post where I explain it in more detail. In short:

  • The /usr/lib/libSystem.B.dylib dynamic library no longer exists on disk because it was rolled into the dynamic linker shared cache.

  • If you set up your build correctly, you don’t need this file because the linker will use the usr/lib/libSystem.B.tbd stub library from the macOS SDK.

As to how you can fix this, it’s hard to say because I don’t have any experience with this specific third-party library. My general advice is that you escalate questions like this to the library developer. However, it sounds like you’ve done that already, with no success. Your only remaining option is to debug the library’s build system yourself. You need to work out why it’s referencing /usr/lib/libSystem.B.dylib directly, rather than the usr/lib/libSystem.B.tbd stub library in the macOS SDK.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"