Craig Otis
Craig Otis

Reputation: 32054

Determining OS X SDK and Deployment Target versions from Framework

Fairly straightforward question - if I have a .framework file, is there a command/tool that can be used to determine the SDK and Deployment Target versions used to create the framework?

Similarly, can this be performed on the application binary stored inside a .app file? I'm looking to automate a script that will go search a list of previously-built apps/frameworks, without having the original .xcodeproj files, and determining their high/low supported OS versions.

Upvotes: 24

Views: 8749

Answers (2)

Dmytro
Dmytro

Reputation: 1390

On Big Sur 11.4 I check with:

otool -l my_binary | grep minos

Output for example:

minos 11.0

Upvotes: 7

cody
cody

Reputation: 3277

To find out the SDK and Deployment Target of some binary you should explore the LC_VERSION_MIN_MACOSX load command. Use otool -l <some_binary> to see load commands.
Example:

$otool -l my_binary
...
Load command 9
      cmd LC_VERSION_MIN_MACOSX
  cmdsize 16
  version 10.7
      sdk 10.8
...

$otool -l /System/Library/Frameworks/CoreWLAN.framework/CoreWLAN 
...
Load command 8
      cmd LC_VERSION_MIN_MACOSX
  cmdsize 16
  version 10.8
      sdk 10.8
...

Example with piping to grep:

otool -l my_binary | grep -A 3 LC_VERSION_MIN_MACOSX

Upvotes: 41

Related Questions