Xcode 16 issues with mac virtualisation

I have created a virtualised Mac machine where I am running the latest Xcode version 16.4 with macOS Sequoia as the base image.

While running XCTest tests, I am observing a clear difference in behaviour between virtualised and non-virtualised setups.

Below is the command I am using to run the tests:

/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -xctestrun /Users/ltuser/290103613/xcui.xctestrun -destination "platform=iOS Simulator,id=79A5F8CC-4A2E-4C91-895D-AE97E25CB824,arch=arm64,OS=18.0" test-without-building "-only-testing:ClassName/MethodName/testName" -derivedDataPath /Users/ltuser/290103613/Archive -verbose IDELogLevel=debug IDETestLogLevel=debug ONLY_ACTIVE_ARCH=YES

Observed Issue

On virtualised hosts:

  • Every XCTest is executed twice
  • This happens for both passed and failed tests
  • The behaviour is consistent across all virtualised machines

On non-virtualised (bare-metal) Macs:

  • Tests execute only once, as expected

Debugging Steps Taken

  1. Multiple destination suspicion

Initially, I noticed the following warning:

--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:iOS Simulator, id:0FFB9082-94AB-4D0A-A731-CC4452BDD4E7, OS:17.0, name:iPhone 15 }
{ platform:iOS Simulator, id:0FFB9082-94AB-4D0A-A731-CC4452BDD4E7, OS:17.0, name:iPhone 15 }

This raised suspicion that tests might be running twice due to multiple matching destinations.

  1. Destination narrowed down

I then explicitly restricted the destination to a single simulator UDID, after which:

  • The warning disappeared
  • However, the issue still persists
  • Tests continue to run twice on virtualised hosts

Version Comparison

  • Xcode 16.4 + macOS Sequoia (virtualised) → Tests run twice
  • Xcode 15.x (same setup otherwise) → Tests run once

Questions

  • Has anyone else faced this issue with Xcode 16.x on virtualised macOS?
  • Is this a known issue with Xcode 16 + Virtualisation?
  • Is there any recommended workaround or configuration change to avoid duplicate test execution?

I am currently blocked on this issue and would appreciate confirmation on whether this is an Xcode or virtualisation-related problem.

Thank you.

Could you please file a Feedback and include the .xcresult bundle generated by xcodebuild? That should have sufficient detail to understand why tests are repeating. Thank you!

Xcode 16 issues with mac virtualisation
 
 
Q