12

Do they share the same UDID? How are they implemented under the hood?

The scenario is I have 4 clones running UI tests in parallel. I need a clean simulator for some tests (but want to keep random test order)

Alexandre G
  • 1,655
  • 20
  • 30

5 Answers5

13

Command to erase all testing simulators (you'll need to restart Xcode after that):

xcrun simctl --set testing delete all

Overall, it should be better to just reset those sims (you won't need to restart after that):

xcrun simctl --set testing shutdown all
xcrun simctl --set testing erase all

To erase specific one you first need to get his ID with list devices and then shutdown and erase:

xcrun simctl --set testing list devices
xcrun simctl --set testing shutdown 2BC2B50E-C4BA-45B9-9C73-AF5097BA1F0B
xcrun simctl --set testing erase 2BC2B50E-C4BA-45B9-9C73-AF5097BA1F0B

Thanks Scott McCoy for his answer.

Anton Plebanovich
  • 1,296
  • 17
  • 17
  • But how do I reset a specific one? Tests are still running on others, and I need to reset one to prepare it for the "clean slate" test – Alexandre G Jan 06 '20 at 01:32
2

I have not been able to find any interface with cloned simulators via simctl. You can completely remove them by deleting their folder under ~/Library/Developer/XCTestDevices. They each get their own UUID, but again, they don't get listed in simctl as far as I can tell.

Michael McGuire
  • 3,770
  • 2
  • 29
  • 28
2

You can list clones like this: xcrun simctl --set testing list

But any time I try to use device IDs with xcrun commands they fail with Invalid device: <device id>

Scott McCoy
  • 308
  • 2
  • 13
0

On your status bar with Xcode open on your mac go to Windows->Devices and Simulators. There you will see a list of all the available simulators and you can add new or delete existing from there.

nishith Singh
  • 2,968
  • 1
  • 15
  • 25
  • Hi, thanks for your answer. I am not seeking to remove a simulator but to erase its data - similar to what `Erase all content and settings does` but through terminal – Alexandre G Oct 06 '18 at 07:10
0

you can reset all the simulators by: xcrun simctl erase all

to reset a particular simulator use: xcrun simctl erase your_simulator_id

mark w.
  • 1,047
  • 9
  • 16