xcode one has the ability to set a default build configuration to use for xcodebuild. E.g. Release or Debug
Yet when I try this on my project, it looks as it is not used as it said it should
$ 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
Given a Debug default configuration:
$ 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;
specifying DEFAULT configuration uses Debug (EXPECTED)
$ 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) ===
and not specifying the configuration uses Debug (EXPECTED)
$ 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 ===
Given Release as default configuration
$ 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;
specifying DEFAULT configuration uses Release (EXPECTED)
$ 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) ===
and not specifying the configuration uses Debug (UNEXPECTED)
$ 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 ===
It's as if:
- defaultConfigurationName is only used if using -configuration DEFAULT
- defaultConfigurationName is ignored if no configuration is specified and only Debug
I don't even know if this is a bug or expected behavior.