`xcodebuild test` fails when destination is iOS Simulator [Xcode 8.0 beta 2]

Originator:benchatelain
Number:rdar://27260158 Date Originated:2016-07-08
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode 8.0 beta 2 (8S162m), Default Swift toolchain
Classification:Serious Bug Reproducible:Always
 
Running the “test” action of xcodebuild on an iOS project always fails when using an iOS Simulator destination

Steps to Reproduce:
1. Navigate to the root of an iOS project folder in Terminal
2. Run `xcodebuild test` with the appropriate arguments for the project’s workspace, scheme and use a destination specifier for an iOS Simulator. For example:

xcodebuild test -workspace Outlets.xcworkspace -scheme Outlets -sdk iphonesimulator -destination="platform=iOS Simulator,name=iPhone 6s Plus,OS=latest"

Expected Results:
xcodebuild will run the tests for the specified scheme.

Actual Results:
xcodebuild always fails to run the tests with a message about a “build only device”, even when a specific simulator is given by name or ID. This is true for all of the following:
- simulator specified by name (e.g. “name=iPhone SE”, “name=iPhone 6”)
- simulator specified by GUID (e.g. "id=B3183F65-0860-47D3-BA02-2FF56126C7BB”)
- OS explicitly specified (e.g. “OS=10.0”, “OS=9.3”)
- OS set to “latest"
- OS not specified (should default to “latest”)

-----
User defaults from command line:
    destination = platform=iOS Simulator,name=iPhone 6s Plus,OS=latest

Build settings from command line:
    SDKROOT = iphonesimulator10.0

xcodebuild: error: Failed to build workspace Outlets with scheme Outlets.
    Reason: A build only device cannot be used to run this target.
-----
xcodebuild test -workspace Outlets.xcworkspace -scheme Outlets -destination="platform=iOS Simulator,id=B3183F65-0860-47D3-BA02-2FF56126C7BB"
User defaults from command line:
    destination = platform=iOS Simulator,id=B3183F65-0860-47D3-BA02-2FF56126C7BB

xcodebuild: error: Failed to build workspace Outlets with scheme Outlets.
    Reason: A build only device cannot be used to run this target.
-----

Configuration: (hardware)
MacBook 12-inch (MacBook8,1), Early 2015

Version & Build:
Xcode 8.0 beta 2 (8S162m)
OS X 10.12 beta 2 (16A239j)

Regression:
Same results for both iOS application and framework projects
- https://github.com/phatblat/CLVisitExplorer
- https://github.com/phatblat/Outlets
- https://github.com/AliSoftware/Reusable

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!