The command line tool to build Xcode projects, xcodebuild, has a new build action available in Xcode 4: archive.
archive
From man xcodebuild:
man xcodebuild
Is this working from the GUI ? Project -> Build for Archive Then you can find the archive back in Organizer (archive Tab) It is working for me in the GUI