Question

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.

Was it helpful?

Solution

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

OTHER TIPS

On Big Sur 11.4 I check with:

otool -l my_binary | grep minos

Output for example:

minos 11.0
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top