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:56

Another thing you can do is to change the Deployment target to the highest value. This will prevent the Scheme Menu from displaying older versions.

To do this go to: Target->Summary then change the Deployment Target.

查看更多
再贱就再见
3楼-- · 2019-01-16 00:59

In addition to @childno.de answer, your Mac directory

/private/var/db/receipts/

may still contains obsolete iPhoneSimulatorSDK .bom and .plist files like this:

/private/var/db/receipts/com.apple.pkg.iPhoneSimulatorSDK8_4.bom /private/var/db/receipts/com.apple.pkg.iPhoneSimulatorSDK8_4.plist

These could make your Downloads tab of Xcode's preferences show a tick () for that obsolete simulator version.

To purge the unwanted simulators, you can do a search using this bash command from your Mac terminal:

sudo find / -name "*PhoneSimulator*"

Then go to corresponding directories to manually delete unwanted SimulatorSDKs

查看更多
登录 后发表回答