Page 1 of 1

MacOS – How to determine library dependencies of a binary?

macOS – How to determine library dependencies of a binary?

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.
Examples: "MacOS X - Your question", "MS Word - Your Tip or Trick".

Please note that switching to another language when reading a post will not work!
Posts will not have a translated counterpart.




RSS Feed

Home Forums Software Development Delphi, Lazarus, Free Pascal macOS – How to determine library dependencies of a binary?

This topic contains 0 replies, has 1 voice, and was last updated by  hans 3 weeks, 4 days ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • 11823

    hans
    Keymaster

    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)
Viewing 1 post (of 1 total)



You must be logged in to reply to this topic.