The man page for xcodebuild
reads:
Run xcodebuild from the directory containing your project (i.e. the directory containing the project
You can set build settings from the command line. The CONFIGURATION_BUILD_DIR
will set the build directory. For example:
xcodebuild -project YourProject.xcodeproj -configuration Debug -target All ARCHS=x86_64 ONLY_ACTIVE_ARCH=YES CONFIGURATION_BUILD_DIR=../some/other/dir
A reference is found on Apple's site: