Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Determining OS X SDK and Deployment Target versions from Framework

Tags:

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.

like image 373
Craig Otis Avatar asked Jul 04 '13 02:07

Craig Otis


People also ask

How do I check my iOS deployment target?

Select the Build Settings tab at the top and search for deployment target. The Deployment section shows four build settings that relate to the deployment target: iOS Deployment Target. macOS Deployment Target.

Where is iOS deployment target in Xcode?

Deployment Target refers to the oldest version of iOS that is capable of running your project. To change your deployment target, open up your project file in Xcode and check the setting under Build Settings -> Deployment(...) Check this answer to add earlier devices support.

What is deployment target?

Deployment targets are what Octopus Deploy deploys to. They can be Windows servers, Linux servers, Kubernetes (K8s) clusters, Azure Web Apps, and more. Environments are how you organize your deployment targets into groups that represent different stages of your deployment pipeline.

How do I change deployment targets in Xcode 11?

Change deployment targetSelect your app target and go to General tab, under Deployment Info change target to whatever version you want to support.


2 Answers

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 
like image 172
cody Avatar answered Oct 30 '22 17:10

cody


On Big Sur 11.4 I check with:

otool -l my_binary | grep minos 

Output for example:

minos 11.0 
like image 21
Dmytro Avatar answered Oct 30 '22 18:10

Dmytro