Reduce Disk Space
- Note: on your own risk
- If don’t do the watchOS related work, delete:
/Applications/Xcode.app/Contents/Developer/Platforms/WatchOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/watchOS.simruntime
- If don’t do the tvOS related work, delete:
/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/tvOS.simruntime
- If only draw UI by programming, not using
storyboard
etc, delete(better keep it):
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime
- do sim cleaning:
xcrun simctl delete unavailable
- delete unused device support files:
~/Library/Developer/Xcode/iOS DeviceSupport
~/Library/Developer/Xcode/watchOS DeviceSupport
- delete
DerivedData
:
~/Library/Developer/Xcode/DerivedData
- delete
CoreSimulator
cache:
~/Library/Developer/CoreSimulator/Caches/dyld
Multiple Versions
If don’t care about the UI of Xcode, you don’t need to install two or more Xcode:
- copy the
XcodeDefault.xctoolchain
from the newer version to
/Applications/Xcode.app/Contents/Developer/Toolchains/
then rename it, and use it later.
2. copy the SDK
to:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
/Applications/Xcode.app/Contents/Developer/Platforms/DriverKit.platform/Developer/SDKs
and choose the sdk in Xcode’s project config pane.
3. copy the DeviceSupport
to:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/DeviceSupport
/Applications/Xcode.app/Contents/Developer/Platforms/WatchOS.platform/DeviceSupport
Enjoy!