Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode unit tests run "clone" iOS simulators

In Xcode, running unit testing targets seems to be creating iOS Simulator 'clones' (named "Clone 1 of iPhone..." and "Clone 2 of iPhone...").

On older machines, this can take a long time. This is happening every time when switching from running the App and running tests. For example, running the App will launch the Simulator. Running tests will launch new one or more Simulators (Clone of ...), and running the App again will reload the original Simulator.

Any way to control this? This makes running tests a real pain on older machines.

Clone 1 and Clone 2

like image 663
bauerMusic Avatar asked Sep 02 '25 16:09

bauerMusic


2 Answers

There is a setting for this in the Xcode build scheme. Click the scheme name in the toolbar of your project window, then go to Edit Scheme -> Test -> <your Test target> -> Options... and uncheck "Execute in parallel (if possible)".

like image 155
Natalia Avatar answered Sep 05 '25 09:09

Natalia


In Xcode 15, the relevant setting is in a different place:

  1. Edit Scheme -> Test -> Test Plans -> (Your Plan) -> (Your Target) -> Options...
  2. Uncheck "Execute in parallel (if possible)"
  3. If prompted, press OK to save changes in a manual test plan.
like image 38
Tom Ross Avatar answered Sep 05 '25 09:09

Tom Ross