问题
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)
回答1:
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.
回答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.
回答3:
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>
回答4:
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.
回答5:
you can reset all the simulators by: xcrun simctl erase all
to reset a particular simulator use: xcrun simctl erase your_simulator_id
来源:https://stackoverflow.com/questions/52660037/how-do-i-erase-an-xcode-10-simulator-clone-through-cli