Published

How to clean up your iOS simulators

I had the same problem recently and looked for an easy way to clean up all the unused simulators. On StackOverflow I found out about xcrun simctl, which lets you list and delete arbitrary simulators. I ended up creating this little shell one-liner to delete all simulator data packages for which the simulator is no longer installed:

This lists all the simulators, filters for the unavailable ones, extracts the simulator IDs, and then iterates over them and deletes them. Be aware, though, that this also deletes your simulators for iOS 9 and watchOS 2 if you did not xcode-select the Xcode beta for your command line tools (and if you did, it might actually delete your simulators for iOS 8.4). In that case, you may want to first output the list of simulators to a file:

xcrun simctl list > simulators.txt

Then edit that file, leaving only the simulators you wish to remove, and execute