Try something similar in the argument list link to xcodebuild
-destination "platform=iOS Simulator,OS=8.0,name=iPhone 6"
This is what is displayed for the project (I am making this assumption based on your context above)
xcodebuild [-project projectname] -scheme schemename [-destination destinationspecifier] [-destination-timeout value] [-configuration configurationname] [-sdk [sdkfullpath | sdkname]] [buildaction ...] [setting=value ...] [-userdefault=value ...]
In one of your examples, you can also specify several destinations.
xcodebuild -workspace MyWorkspace.xcworkspace -scheme MyScheme -destination 'platform=iOS Simulator,name=iPhone' -destination 'platform=iOS,name=My iPad' test
I am personally in a project that uses a workspace, so I need to list the scheme.
Side note, I noticed that you set TARGET_BUILD_DIR and BUILD_PRODUCTS. I install OBJROOT and SYMROOT, and the directories exit just as if I were using the Xcode GUI.
The final example is a real example of using the destination flag.
BUILDDIR="<path/to/build/directory>" xcodebuild -workspace "<path/to/workspace/>my.xcworkspace" -scheme "NameOfMySchemeToBuild" -destination "platform=iOS Simulator,OS=8.0,name=iPhone 6" -configuration "Release" OBJROOT=$BUILDDIR SYMROOT=$BUILDDIR
Hope this helps!
source share