Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I erase an Xcode 10 simulator clone through CLI?

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)

like image 441
Alexandre G Avatar asked Oct 05 '18 07:10

Alexandre G


People also ask

How do I clear my Xcode simulator?

To delete individual, available, simulators it's easier to do so through Xcode. Go to Window > Devices and simulators, then select the Simulators tab. You can right-click on any simulator and select 'delete' to get rid of it.

How do I delete data from simulator?

To remove all data and settings from an iOS simulator, just click Device then select Erase All Content and Settings from the drop-down menu: A confirm dialog will show up. Click on the Erase button: The process will take a while to finish.

How do I start Xcode simulator from terminal?

In this article, I collected several options on how to launch the simulator from the Terminal, folder, search, and Xcode. Choose which option you like more and use. The basic way to open a list of simulators is to use Xcode -> Window -> Devices and Simulators. Here you can create and manage all available simulators.

How do I change the simulator in Xcode?

Open Xcode and click Menu > Xcode > Preferences > Select Components, and then choose the simulator version you want to download. When a simulator is opened from AppStudio, AppStudio Player automatically installs (if necessary) and opens in it.


1 Answers

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.

like image 84
Anton Plebanovich Avatar answered Sep 27 '22 17:09

Anton Plebanovich