Xcode Simulator: how to remove older unneeded devi

2019-01-16 00:13发布

I'm running Xcode 4.3.1 iOS-Simulator which originally only supports iOS 5.1.

I need to test my code with iOS 4.3, so I used Xcode's "Install" feature to install it as described in "Installing Xcode with iOS 4.3 device simulator?"

Now I'm finished with testing but cannot find a way to uninstall the 4.3 portions ("iPhone 4.3 Simulator" and "iPad 4.3 Simulator"). I want to reduce the clutter in the Scheme menu.

No one on Apple's Xcode listserv knew the answer!

EDIT: note that much has changed since Xcode 4.3, so suggest anyone reading this look at all the answers. The newest ones such as Steve Moser's may be of more use to you!

EDIT 10/2017: Posted on Twitter by Julio Carrettoni‏

If you are an iOS developer, execute this:
$ xcrun simctl delete unavailable
It removes old simulators Xcode no longer use. For me it was 6Gb Did not try it myself...

[Also, I just saw Russ Bishop mentioned this in a comment below already...]

14条回答
女痞
2楼-- · 2019-01-16 00:35

Did you tried to just delete the 4.3 SDK from within the Xcode Package?

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs

please also delete the corresponding .dmg file in

~/Library/Caches/com.apple.dt.Xcode/Downloads

to prevent Xcode from re-installing the same package again.


for XCode >= 6 see @praveen-matanam 's answer

查看更多
Rolldiameter
3楼-- · 2019-01-16 00:35

Run this command in terminal to remove simulators that can't be accessed from the current version of Xcode (8+?) in use on your machine.

xcrun simctl delete unavailable

Also if you're looking to reclaim simulator related space Michael Tsai found that deleting sim logs saved him 30 GB.

~/Library/Logs/CoreSimulator
查看更多
在下西门庆
4楼-- · 2019-01-16 00:36

following some of the answers here, deleting some simulators from my xcode Menu > Window > Devices > Simulators did nothing to help my dying disk space: enter image description here

however by going to /Users/abdullah/Library/Developer/Xcode/iOS DeviceSupport and running du -sh * I got all of these guys:

2.9G    10.0.1 (14A403)
1.3G    10.1.1 (14B100)
2.9G    10.3.2 (14F89)
1.3G    10.3.3 (14G60)
1.9G    11.0.1 (15A402)
1.9G    11.0.3 (15A432)
2.0G    11.1.2 (15B202)
2.0G    11.2 (15C114)
2.0G    11.2.1 (15C153)
2.0G    11.2.2 (15C202)
2.0G    11.2.6 (15D100)
2.0G    11.4 (15F79)
2.0G    11.4.1 (15G77)
2.3G    12.0 (16A366)
2.3G    12.0.1 (16A404)
2.3G    12.1 (16B92)

All together that's 33 GB!

A blood bath ensued

see more details here

查看更多
Explosion°爆炸
5楼-- · 2019-01-16 00:36

Command+Space

Type 'simulator'

open the old beta simulator you no longer need.

right-click on it in the dock, then choose Options>'Show in Finder'

Close the app, then remove it from the folder.

:)

查看更多
Emotional °昔
6楼-- · 2019-01-16 00:38

In Xcode 6+ you can simply go to Menu > Window > Devices > Simulators and delete a simulator you don't need.

查看更多
老娘就宠你
7楼-- · 2019-01-16 00:43

I tried all answers. None of them worked for me.

What worked for me on Sierra + Xcode 8.2 was going to:

/Library/Developer/CoreSimulator/Devices and deleting all devices.

(Maybe this won't work for you, maybe this is a solution as a standalone, or maybe you have to do this in addition to other answers, but I did all solutions here and so not sure what did the deed). Just be aware that some of the answers here are old and the location of simulator has changed. Snowcrash's answer seems to be most recent.

查看更多
登录 后发表回答