Xcode 11
I found this question because I had already finished debugging my app and I wanted to make a release build for the app store. I always forget which menu item to use, though. This answer is a reminder to me and others next time.
Choose the Generic iOS Device from the active scheme menu.
Then go to Product > Archive.
You may have to wait a little while for Xcode to finish archiving your project. After that you will be shown a dialog with your archived project. You can select Distribute app... and follow the prompts.
More Help
This answer is for those who are already all signed up with a developer account and just need to get the archive from Xcode to iTunes Connect. If you need more help signing up for a developer account and getting an app to the app store, read the following links.
This works, care to explain the downvote? When you Archive, you get the binary in built in the release mode the archive. This might not be the most practical way of getting the build, but that depends on blackguardian's use case. – zoul Apr 18 '11 at 18:17
The questions isn't "How to I create a distribution in Xcode?" Creating 'release build' is a normal activity (and to debug them) when the compiler optimizes code incorrectly or verifying debug release only options are disabled. The answer is below, but in short press SHIFT+COMMAND+, and edit the scheme to run release. – maninvan Oct 4 '15 at 2:45