Xcode Simulator: how to remove older unneeded devices?

前端 未结 19 1723
遇见更好的自我
遇见更好的自我 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:20

    You can use the following snippet to delete unavailable runtimes:

    echo "rm -rf $(xcrun simctl list runtimes -j |\
          jq ".runtimes[] | select(.isAvailable|not) | .bundlePath" | xargs)"
    

    to execute, remove echo or add | bash at the end.

    If you don't have jq command available, you can get it using brew install jq

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

    I had the same problem. I was running out of space.

    Deleting old device simulators did NOT help.

    My space issue was caused by xCode. It kept a copy of every iOS version on my macOS since I had installed xCode.

    Delete the iOS version you don't want and free up disk space. I saved 50GB+ of space.



    NOTE -> can't you see ~/Library inside Finder? It is hidden by default. Use Terminal and type cd ~/Library/Developer/Xcode/iOS\ DeviceSupport/ or google how to see hidden folders.



    NOTE -> if you have multiple users on a single macOS machine, make sure to find the directory ONLY with the user account that originally installed xCode.

    0 讨论(0)
  • 2020-12-02 04:25
    1. Open Xcode --> Go to Window (from menu bar) --> Devices and Simulators --> Click on Simulator --> Right-click on the simulator that you want to delete --> Click Delete

    2. To delete any unwanted simulators that you installed in the past as an extra Component through Xcode.

    • Open Terminal

    • Type open /Library/Developer/CoreSimulator/Profiles/Runtimes

    • Delete undesired simulators

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

    Xcode 4.6 will prompt you to reinstall any older versions of the iOS Simulator if you just delete the SDK. To avoid that, you must also delete the Xcode cache. Then you won't be forced to reinstall the older SDK on launch.

    To remove the iOS 5.0 simulator, delete these and then restart Xcode:

    1. /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/PhoneSimulator5.0.sdk
    2. ~/Library/Caches/com.apple.dt.Xcode

    For example, after doing a clean install of Xcode, I installed the iOS 5.0 simulator from Xcode preferences. Later, I decided that 5.1 was enough but couldn't remove the 5.0 version. Xcode kept forcing me to reinstall it on launch. After removing both the cache file and the SDK, it no longer asked.

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

    The problem with these answers is that, with every Xcode update, menus and locations will change.

    Just go to /Applications/Xcode.app/Contents/Developer/Platforms and delete what you don't need. Xcode will start fine. If you're at all concerned then you can simply restore from Trash.

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

    In XCode open Window - Devices, then select and remove the outdated simulators.

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