Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Determine minimum OSX version a binary was compiled for

Use otool -l /path/to/binary and inspect the LC_VERSION_MIN_MACOSX load command; specifically, the version field.

For example, a binary compiled with the 10.8 SDK with deployment target (-mmacosx-version-min) 10.8 should have an LC_VERSION_MIN_MACOSX like this:

Load command 9
      cmd LC_VERSION_MIN_MACOSX
  cmdsize 16
  version 10.8
      sdk 10.8

whereas a binary compiled with the 10.8 SDK with deployment target 10.7 should have an LC_VERSION_MIN_MACOSX load command like this:

Load command 9
      cmd LC_VERSION_MIN_MACOSX
  cmdsize 16
  version 10.7
      sdk 10.8

The load command that is mentioned in the accepted answer is not listed when I build a modern macOS executable. However LC_BUILD_VERSION does contain the minos and sdk fields:

Load command 10
      cmd LC_BUILD_VERSION
  cmdsize 32
 platform 1
    minos 11.0
      sdk 11.1
   ntools 1
     tool 3
  version 609.8