I am trying to delete a Simulator but it is in a state which simctl delete
will not delete it. I removed it from all the places I can think, but a reference to it is preserved somewhere.
First, the listing:
$ xcrun simctl list devices | grep 3B7 Apple Watch - 38mm (3B7135C5-40A3-40FB-A130-12ACB448EE5D) (Creating) (unavailable, runtime profile not found)
Next, my delete attempt:
$ xcrun simctl delete 3B7135C5-40A3-40FB-A130-12ACB448EE5D An error was encountered processing the command (domain=com.apple.CoreSimulator.SimError, code=159): Unable to delete device in current state: Creating
I next deleted the device directory, the entry from device_set.plist
, and even the entry in .default_created.plist
. Proof:
$ pwd; ls -l 3* /Users/jeff/Library/Developer/CoreSimulator/Devices ls: 3*: No such file or directory $ grep 3B7 device_set.plist .default_created.plist ; echo Anything? Anything?
But that did not help. It was still there.
So without deleting the entire CoreSimulator/Devices
folder, how do I remove this corrupt device entry?
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.
Simctl is a tool to help manage and programmatically interface with the simulator. You can access simctl using the xcrun command-line tool. Now, you'll explore several of these subcommands. Run the following: xcrun simctl list. The list command shows the list of all the available devices and the runtimes.
You deleted it on disk, but CoreSimulatorService was running during that time and has no idea that you undermined its authority ;0.
If you sudo killall -9 com.apple.CoreSimulator.CoreSimulatorService
, it'll restart and not see it on the next launch.
Also note that this particular bug was fixed in Xcode 8. You can now delete unavailable devices stuck in the creating state.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With