How do I print a list of "Build Settings" in Xcode project?

Viewed 116126

Alternate Titles

  • List of Xcode build variables
  • Print a list of Xcode Build Settings
  • Clang Environment Variables
  • Canonical list of Xcode Environment Variables

Is there a Canonical list of Xcode Environment Variables that can be used in Build Rules etc?

7 Answers

In case you would like to read/check your Target Build Settings in runtime using code, here is the way:

1) Add a Run Script:

cp ${PROJECT_FILE_PATH}/project.pbxproj ${CONFIGURATION_BUILD_DIR}/${EXECUTABLE_NAME}.app/BuildSetting.pbxproj 

It will copy the Target Build Settings file into your Main Bundle (will be called BuildSetting.pbxproj).

2) You can now check the contents of that file at any time in code:

NSString *thePathString = [[NSBundle mainBundle] pathForResource:@"BuildSetting" ofType:@"pbxproj"];
NSDictionary *theDictionary = [NSDictionary dictionaryWithContentsOfFile:thePathString];
Related