Search code examples
iosxcodebuild-settings

Accessing Deployment Target in unit test code


I need to know my deployment target in my unit test cases. Is there any way to get the iOS deployment target programmatically (using Objective-C)?

enter image description here


Solution

  • Displays as a 'big' int:

    NSLog(@"Deployment target: %i", __IPHONE_OS_VERSION_MIN_REQUIRED);
    

    e.g. for iOS 5.1 as the deployment target

    Deployment target: 50100