Regression: xcodebuild no longer infers destination platform and OS from named iOS simulator

Originator:richardb
Number:rdar://24033506 Date Originated:3 Jan 2016
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode Version 7.2 (7C68)
Classification:Other Bug Reproducible:Always
 
Summary:
In Xcode 7.1.1 and earlier, specifying an iOS simulator by name to xcodebuild would imply the associated platform and OS. This is no longer the case and now the platform and OS must be supplied redundantly.

Steps to Reproduce:
1. Create a new iOS project with Xcode 7.1.1 or earlier.
2. Select Xcode 7.1.1 through xcode-select or DEVELOPER_DIR.
3. Create a new iOS simulator named "Test" using for example:
xcrun simctl create Test com.apple.CoreSimulator.SimDeviceType.iPhone-6 com.apple.CoreSimulator.SimRuntime.iOS-9-1
4. Run the tests with:
xcodebuild -configuration Debug -scheme <scheme> -destination name=Test clean test
5. Observe success.
6. Select Xcode 7.2 through xcode-select or DEVELOPER_DIR.
7. Repeat steps 3 and 4.

Expected Results:
Xcode 7.2 should successfully run the tests in the named iOS simulator.

Actual results:
Xcode 7.2 fails to infer the platform and OS and fails with:

xcodebuild: error: Unable to find a destination matching the provided destination specifier:
		{ name:Test }

	Unsupported device specifier option.
	The device “My Mac” does not support the following options: name
	Please supply only supported device specifier options.

	Available destinations for the "DestinationTest" scheme:
		{ platform:iOS Simulator, id:2B1AFBD4-D9FC-411B-84F0-3C22C1EB122E, OS:9.1, name:Test }
		{ platform:iOS Simulator, id:4E8D841F-710C-42C8-A0D3-0441C31135D7, OS:9.1, name:iPad 2 }
		…

Notes:

A workaround is to pass the platform and OS redundantly like this:
xcodebuild -configuration Debug -scheme <scheme> -destination "platform=iOS Simulator,OS=9.1,name=Test" clean test

This is redundancy is undesirable as it breaks the DRY principle.

The attached archive contains:
* A sample project (just a Single View App template with the deployment target lowered to 9.0)
* A script to run test builds consistently and gather versioned logs
* Example output from Xcode 7.1.1 and 7.2.

rdar://23973685 may be related. (https://openradar.appspot.com/23973685)

Xcode Version 7.2 (7C68)
OS X 10.10.5 (14F1509)

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!