By default, project generated files are stored in ~/Library/Developer/Xcode.

We can change them in Locations Preferences:


DerivedData is a new thing that arrives with XCode 4 (cleaning DerivedData). With XCode 4, there is a concept of workspace – which allows multiple projects to be grouped together.

Every workspace has a unique set of symbol indexes, build products, window layouts, referred as derived data. The Derived Data contains: intermediate build information, debug and release builds, and project’s index.

When we have index problems (code completion not right, constant re-indexing, a slow project…), we should DELETE the Derived Data for that project. (use the Option key to show the Clean Build Folder option – this will delete the subfolder for that project).

The Archives folder contains the archived builds: release build + dSYM data. DO NOT DELETE this (the dSYM is must have to debug the previously deployed versions).


  1. To list all targets, build configurations, and schemes used in your project
    xcodebuild -list -project <your_project_name>.xcodeproj
  2. To build a scheme
    xcodebuild -scheme <your_scheme_name> build
  3. To build target with a configuration file
    xcodebuild -target <your_target_name> -xcconfig <your_configuration_file>.xcconfig
  4. Test

Xcode Scheme

A scheme defines:

  1. targets to build,
  2. configuration to use when building,
  3. tests to execute.

Where a scheme is stored:

  1. stored in a project — scheme is available in every workspace that includes that project,
  2. stored in the workspace — available only in that workspace.


OSX command lines

  • awk: find & replace text within file