Page 1 of 1
Forum

Welcome to the Tweaking4All community forums!
When participating, please keep the Forum Rules in mind!

Topics for particular software or systems: Start your topic link with the name of the application or system.
For example “MacOS X – Your question“, or “MS Word – Your Tip or Trick“.

Please note that switching to another language when reading a post will not bring you to the same post, in Dutch, as there is no translation for that post!



Share:
Notifications
Clear all

[Solved] macOS - How to determine library dependencies of a binary?

1 Posts
1 Users
0 Likes
13 K Views
 Hans
(@hans)
Famed Member Admin
Joined: 11 years ago
Posts: 2678
Topic starter  

Sometimes I'd like to know if a binary - the actual executable, either a command-line tool or the binary in an app-bundle (mybundle.app/Contents/MacOS/xyz) - uses a particular library (dll in windows-world, dylib in macOS world).

I found this to be the easiest way to do this:

otool -L <thebinary>

For example, to see what libraries the command-line tool "diskutil" uses:

otool -L /usr/sbin/diskutil

Which gives a list like below, showing the used libraries:

 /usr/lib/libcsfde.dylib (compatibility version 1.0.0, current version 1.0.0)
 /usr/lib/libCoreStorage.dylib (compatibility version 1.0.0, current version 1.0.0)
 /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 1570.15.0)
 /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
 /System/Library/PrivateFrameworks/DiskManagement.framework/Versions/A/DiskManagement (compatibility version 1.0.0, current version 1.0.0)
 /System/Library/Frameworks/DiscRecording.framework/Versions/A/DiscRecording (compatibility version 1.0.0, current version 1.0.0)
 /usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0, current version 5.4.0)
 /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration (compatibility version 1.0.0, current version 1.0.0)
 /usr/lib/libicucore.A.dylib (compatibility version 1.0.0, current version 62.1.0)
 /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
 /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.250.1)
 /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1570.15.0)

   
ReplyQuote
Share: