title: Unexpected effect of the default build configuration in xcode
body: <p>xcode one has the ability to set a default build configuration to use for xcodebuild. E.g. Release or Debug</p>
  
  <p><a href="https://developer.apple.com/library/ios/technotes/tn2339/_index.html#//apple_ref/doc/uid/DTS40014588-CH1-MY_APP_HAS_MULTIPLE_BUILD_CONFIGURATIONS__HOW_DO_I_SET_A_DEFAULT_BUILD_CONFIGURATION_FOR_XCODEBUILD_" rel="nofollow">https://developer.apple.com/library/ios/technotes/tn2339/_index.html#//apple_ref/doc/uid/DTS40014588-CH1-MY_APP_HAS_MULTIPLE_BUILD_CONFIGURATIONS__HOW_DO_I_SET_A_DEFAULT_BUILD_CONFIGURATION_FOR_XCODEBUILD_</a></p>
  
  <p>Yet when I try this on my project, it looks as it is not used as it said it should</p>
  
  <pre><code>$ echo $DEVELOPER_DIR
  /Applications/Xcode6.0.1.app/Contents/Developer 
  $ xcodebuild  -list
  Information about project "CocoaPodsExample":
      Targets:
          CocoaPodsExample
          CocoaPodsExampleTests
  
      Build Configurations:
          Debug
          Release
  
      If no build configuration is specified and -scheme is not passed then "Release" is used.
  
      Schemes:
          CocoaPodsExample
  </code></pre>
  
  <p>Given a Debug default configuration:</p>
  
  <pre><code>$ git grep defaultConfigurationName
  CocoaPodsExample.xcodeproj/project.pbxproj:                     defaultConfigurationName = Debug;
  CocoaPodsExample.xcodeproj/project.pbxproj:                     defaultConfigurationName = Debug;
  CocoaPodsExample.xcodeproj/project.pbxproj:                     defaultConfigurationName = Debug;
  Pods/Pods.xcodeproj/project.pbxproj:                    defaultConfigurationName = Debug;
  Pods/Pods.xcodeproj/project.pbxproj:                    defaultConfigurationName = Debug;
  Pods/Pods.xcodeproj/project.pbxproj:                    defaultConfigurationName = Debug;
  </code></pre>
  
  <p>specifying DEFAULT configuration uses Debug (<strong>EXPECTED</strong>)</p>
  
  <pre><code>$ xcodebuild -scheme CocoaPodsExample -workspace CocoaPodsExample.xcworkspace -configuration DEFAULT build | grep "CONFIGURATION"
  === BUILD TARGET Pods-AFNetworking OF PROJECT Pods WITH THE DEFAULT CONFIGURATION (Debug) ===
  === BUILD TARGET Pods OF PROJECT Pods WITH THE DEFAULT CONFIGURATION (Debug) ===
  === BUILD TARGET CocoaPodsExample OF PROJECT CocoaPodsExample WITH THE DEFAULT CONFIGURATION (Debug) ===
  === BUILD TARGET CocoaPodsExampleTests OF PROJECT CocoaPodsExample WITH THE DEFAULT CONFIGURATION (Debug) ===
  </code></pre>
  
  <p>and not specifying the configuration uses Debug (<strong>EXPECTED</strong>)</p>
  
  <pre><code>$ DEVELOPER_DIR=/Applications/Xcode6.0.1.app/Contents/Developer xcodebuild -scheme CocoaPodsExample -workspace CocoaPodsExample.xcworkspace build | grep "CONFIGURATION"
  === BUILD TARGET Pods-AFNetworking OF PROJECT Pods WITH CONFIGURATION Debug ===
  === BUILD TARGET Pods OF PROJECT Pods WITH CONFIGURATION Debug ===
  === BUILD TARGET CocoaPodsExample OF PROJECT CocoaPodsExample WITH CONFIGURATION Debug ===
  === BUILD TARGET CocoaPodsExampleTests OF PROJECT CocoaPodsExample WITH CONFIGURATION Debug ===
  </code></pre>
  
  <p>Given Release as default configuration</p>
  
  <pre><code>$ git grep defaultConfigurationName
  CocoaPodsExample.xcodeproj/project.pbxproj:                     defaultConfigurationName = Release;
  CocoaPodsExample.xcodeproj/project.pbxproj:                     defaultConfigurationName = Release;
  CocoaPodsExample.xcodeproj/project.pbxproj:                     defaultConfigurationName = Release;
  Pods/Pods.xcodeproj/project.pbxproj:                    defaultConfigurationName = Release;
  Pods/Pods.xcodeproj/project.pbxproj:                    defaultConfigurationName = Release;
  Pods/Pods.xcodeproj/project.pbxproj:                    defaultConfigurationName = Release;
  </code></pre>
  
  <p>specifying DEFAULT configuration uses Release (<strong>EXPECTED</strong>)</p>
  
  <pre><code>$ xcodebuild -scheme CocoaPodsExample -workspace CocoaPodsExample.xcworkspace -configuration DEFAULT build | grep "CONFIGURATION"
  === BUILD TARGET Pods-AFNetworking OF PROJECT Pods WITH THE DEFAULT CONFIGURATION (Release) ===
  === BUILD TARGET Pods OF PROJECT Pods WITH THE DEFAULT CONFIGURATION (Release) ===
  === BUILD TARGET CocoaPodsExample OF PROJECT CocoaPodsExample WITH THE DEFAULT CONFIGURATION (Release) ===
  === BUILD TARGET CocoaPodsExampleTests OF PROJECT CocoaPodsExample WITH THE DEFAULT CONFIGURATION (Release) ===
  </code></pre>
  
  <p>and not specifying the configuration uses Debug (<strong>UNEXPECTED</strong>)</p>
  
  <pre><code>$ xcodebuild -scheme CocoaPodsExample -workspace CocoaPodsExample.xcworkspace build | grep "CONFIGURATION"
  === BUILD TARGET Pods-AFNetworking OF PROJECT Pods WITH CONFIGURATION Debug ===
  === BUILD TARGET Pods OF PROJECT Pods WITH CONFIGURATION Debug ===
  === BUILD TARGET CocoaPodsExample OF PROJECT CocoaPodsExample WITH CONFIGURATION Debug ===
  === BUILD TARGET CocoaPodsExampleTests OF PROJECT CocoaPodsExample WITH CONFIGURATION Debug ===
  </code></pre>
  
  <p>It's as if:</p>
  
  <ul>
  <li><strong>defaultConfigurationName is only used if using -configuration DEFAULT</strong></li>
  <li><strong>defaultConfigurationName is ignored if no configuration is specified and only Debug</strong></li>
  </ul>
  
  <p>I don't even know if this is a bug or expected behavior.</p>