Xcode project scheme is not currently configured for the test action
For me the problem was that no tests were added to my scheme:
By adding test bundles to my scheme via the '+' button then the scheme could be built by Xcode and xcodebuild.
For everyone struggling with this problem.
My solution was to:
- Select Test Target
- Manage Scheme
- Select Run in the left menu
- Select Info in the tab
- Choose Executable Target from the dropdown menu
- Hit Close.
Fixed this up by removing duplicate schemes from Xcode. The schemes can be added/removed/shared/edited in Xcode via Product -> Scheme -> Manage Schemes.