Xcode Simulator: how to remove older unneeded devices?

前端 未结 19 1722
遇见更好的自我
遇见更好的自我 2020-12-02 03:56

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

相关标签:
19条回答
  • 2020-12-02 04:08

    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.

    0 讨论(0)
  • 2020-12-02 04:09

    In Xcode 6 and above, you can find and delete the simulators from the path /Library/Developer/CoreSimulator/Profiles/Runtimes. Restart Xcode in order to take effect (may not be needed).

    0 讨论(0)
  • 2020-12-02 04:11

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

    0 讨论(0)
  • 2020-12-02 04:12

    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

    0 讨论(0)
  • I wrote up one-line bash script that would delete ALL your simulators:

    xcrun simctl list devices | grep -E -o -i "([0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12})" | xargs -L1 xcrun simctl delete
    
    • xcrun simctl list devices will list all the simulators installed on your machine
    • grep -E -o -i "([0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12})" will grab the device UUID
    • xargs -L1 xcrun simctl delete will attempt to delete the device for each UUID it found

    If you want to see everything it'll execute, you can add echo before xcrun, i.e.

    xcrun simctl list devices | grep -E -o -i "([0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12})" | xargs -L1 echo xcrun simctl delete
    
    0 讨论(0)
  • 2020-12-02 04:12

    On Mac, check /Library/Developer/Xcode/iOS\ DeviceSupport

    iOS DeviceSupport

    0 讨论(0)
提交回复
热议问题