xcodebuild: error: option 'Destination' requires at least one parameter of the form 'key=value'

Viewed 8473

I'm using Visual Studio Team Services to build my app. When I try to run unit tests, I'm getting an error:

xcodebuild: error: option 'Destination' requires at least one parameter of the form 'key=value'

This started after upgrading to Xcode 8.3. The build server has 8.3, but when I run unit tests it wants to use the 8.2 simulator. This fails.

When I try to specify the 8.3 simulator explicitly, using the -destination switch, it fails.

-destination "platform=iOS Simulator,name=iPad Pro (9.7 inch),OS=10.3"

I've also tried using apostrophes ' around the destination, no quotes or apostrophes, and simulator IDs, but nothing helps. Without quotes, I get this error:

xcodebuild: error: Unknown build action 'Pro'.
5 Answers

Single quotes with Equal separator works in form of 'key=value', as:

-destination 'platform=iOS Simulator,OS=12.1,name=iPhone X'

To get the list of Known Devices use:

instruments -s devices

For XCode Version 13.2.1, try the below command:

xcodebuild clean build -scheme App -project App.xcodeproj -destination 'platform=iOS Simulator,OS=15.2,name=iPhone 13 Pro'

Where: App is the scheme name and App.xcodeproj is the App name.

Related