This may have been the case in earlier versions of Xcode, but I am not sure. I noticed that archiving using a command line (like a script via jenkins would do) DOES NOT allow me to override the configuration using the xcodebuild argument option.
Example:
I would like to produce an archive of "TestScheme" using a workspace file "testscheme.xcworkspace"
Here is the relevant piece of my TestScheme.xcscheme
<ArchiveAction
buildConfiguration = "Ad Hoc"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
Here is what I run at the command line to build my archive:
xcodebuild -scheme TestScheme -workspace testscheme.xcworkspace -configuration someotherconfig archive
What is produced is an archive built with the "Ad Hoc" configuration. I poured over my xcscheme file, xcworkspace dir and the like and I can't see why the "-configuration" command line argument has no effect whatsoever.