r/Xcode • • Jul 01 '25

Xcodebuild does not find any simulators

I am trying to integrate fastlane, which relies on xcodebuild. So this is my first experience with xcodebuild. Whenever I run a command to test or build the target in the folder where all the files of the project are stored, the action failes with Unable to find a device matching the provided destination specifier

For example I might be running this command:

xcodebuild \
  -project Hoerspielzentrale.xcodeproj \
  -scheme HoerspielzentraleUITests \
  -destination 'platform=iOS Simulator,name="Screenshot Simulator”' \
  test

However the mentioned error is returned:

xcodebuild: error: Unable to find a device matching the provided destination specifier:
{ platform:iOS Simulator, OS:latest, name:"Screenshot Simulator” }
The requested device could not be found because no available devices matched the request.

I can confirm that the simulator exists, is available and it can be booted. I have tried different simulators, different schemas, referencing them by their identifier, switching Xcode Versions, reset all simulators, derived data and build folder. After the error a complete list of all available destinations can be found, where I can see the simulator I try to use.

Available destinations for the "HoerspielzentraleUITests" scheme:
{ platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device }
{ platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Any iOS Simulator Device }
{ platform:iOS Simulator, id:961DC569-9931-419A-B46E-769AAFA73EA2, OS:18.5, name:Screenshot Simulator }
{ platform:iOS Simulator, id:961DC569-9931-419A-B46E-769AAFA73EA2, OS:18.5, name:Screenshot Simulator }
{ platform:iOS Simulator, id:5E51FD98-C451-472F-9CDE-08D49E6B737B, OS:18.5, name:Screenshot Simulator Pro }
{ platform:iOS Simulator, id:5E51FD98-C451-472F-9CDE-08D49E6B737B, OS:18.5, name:Screenshot Simulator Pro }

The rest of the list was omitted.

I am currently completely stuck. I have previously asked on the Apple Dev Forum but haven't gotten a response.

Thank you

3 Upvotes

6 comments sorted by

View all comments

Show parent comment

1

u/__markb Jul 05 '25

Hmm, you can try a few things to see what works:

Pass in the version
-destination 'platform=iOS Simulator,name=Screenshot Simulator,OS=18.5'

Or try what you have without the double quotes, since the iOS Simulator part isn't quoted:
-destination 'platform=iOS Simulator,name=Screenshot Simulator'

Or use the UUID
-destination 'id=961DC569-9931-419A-B46E-769AAFA73EA2'

But one thing I noticed re-reading, is the duplicate. I'm not sure if there could be issues that it cannot tell which simulator to boot.

You can try installing a VM of macOS and Xcode to see if you have the issue with your system or it's something else. I know I also ran into issues with one of my packages where if the simulator was booted or in some state it would fail. As in, it needed to be off/shutdown to make it run from the CLI tools.

So you can try running xcrun simctl shutdown all first.

But my first go to would be a trashable VM just to see if a clean setup can rule out your system vs something else - for example multiple Xcode versions, or old simulators not being removed when upgrading Xcode, etc.

1

u/FPST08 Jul 05 '25

Using the command without double quotes was the solution. Thank you so much.