Xcode 16 | xcodebuild fails when providing -destination 'platform=iOS Simulator,name=iPhone 16,arch=x86_64'

Hello. In the Xcode 15 we were using this command in the terminal to run our tests on the Rosetta Simulator:

xcodebuild -workspace CoreLibraries.xcworkspace -scheme CoreLibraries -destination 'platform=iOS Simulator,name=iPhone 15,arch=x86_64' test`

In the Xcode 16 the same command doesn't work anymore. It produces the error:

xcodebuild: error: Unable to find a device matching the provided destination specifier:
{ platform:iOS Simulator, arch:x86_64, OS:latest, name:iPhone 16 }
Unsupported device specifier option.
The device “iPhone 16” does not support the following options: arch
Please supply only supported device specifier options.

Running test directly from the Xcode UI using iPhone 16 (Rosetta) still works fine.

Does anyone know how to modify the xcodebuild command to make it work again?

Seeing the same issue when trying to build a project on CI

I see the same issue on my side.

I see the same issue after upgrading to Xcode 16 and trying to do a build from the command line.

Same here. Looks like there is no way to force xCode to use Rosetta, when using xCode 16.

We are facing the same issue 👀

The solution for this seems to be to omit the arch=x86_64 from the destination and pass it as a var instead:

xcodebuild -workspace CoreLibraries.xcworkspace -scheme CoreLibraries -destination 'platform=iOS Simulator,name=iPhone 15' ARCHS=x86_64 test

Awesome, that's it! Thank you so much 🥳 Where did you find the solution/hint/doc? 🤓

That means for our fastlane setup, I just needed to add ARCHS=x86_64 to the xcargs

  xcodebuild(
    workspace: 'dummy.xcworkspace',
    scheme: 'dummy',
    destination: 'platform=iOS Simulator,name=iPhone 15',
    buildlog_path: dummy_path,
    xcargs: '-quiet ARCHS=x86_64'
  )

*the -quiet is not part of the solution *

But it would be interesting anyway to know where it's documented to use this instead of arch in the destination string

You can find the description by running the following command in Terminal:

man xcodebuild

** Destinations**

The -destination option takes as its argument a destination specifier describing the device (or devices) to use as a destination.

  • macOS

The local Mac, referred to in the Xcode interface as My Mac, and which supports the following keys:

arch The architecture to use, e.g. arm64 or x86_64. variant The optional variant to use, e.g. Mac Catalyst or macOS.

  • iOS

An iOS device, which supports the following keys:

id The identifier of the device to use, as shown in the Devices window. A valid destination specifier must provide either id or name, but not both.

name The name of the device to use. A valid destination specifier must provide either id or name, but not both.

OS When specifying the simulated device by name, the iOS version for that simulated device, such as 6.0, or the string latest (the default) to indicate the most recent version of iOS supported by this version of Xcode.

  • iOS Simulator

A simulated iOS device, which supports the following keys:

id The identifier of the simulated device to use, as shown in the Devices window. A valid destination specifier must provide either id or name, but not both.

name The name of the simulated device to use. A valid destination specifier must provide either id or name, but not both.

OS When specifying the simulated device by name, the iOS version for that simulated device, such as 6.0, or the string latest (the default) to indicate the most recent version of iOS supported by this version of Xcode.

@marian_gl

Running test directly from the Xcode UI using iPhone 16 (Rosetta) still works fine. Does anyone know how to modify the xcodebuild command to make it work again?

The fact that you can't specify a Rosetta simulator when building from the command line appears to be a bug. Please file a bug report using Feedback Assistant, then post the Feedback number here

.

simulated

Xcode 16 | xcodebuild fails when providing -destination 'platform=iOS Simulator,name=iPhone 16,arch=x86_64'
 
 
Q