So you want to build your xcodeproject from the command line, but it’s building the wrong architecture?
add this to the end of your xcodebuild command line:
ARCHS="i386 x86_64"
or whatever architecture you want.
For example:
xcodebuild -configuration Optimized ARCHS="i386 x86_64"