ls -l
total 0
drwxr-xr-x 10 root wheel 320 Dec 18 14:37 AppleTVOS.platform
drwxr-xr-x 7 root wheel 224 Dec 18 15:10 AppleTVSimulator.platform
drwxr-xr-x 8 root wheel 256 Dec 18 14:44 MacOSX.platform
drwxr-xr-x 10 root wheel 320 Dec 18 15:10 WatchOS.platform
drwxr-xr-x 7 root wheel 224 Dec 18 15:10 WatchSimulator.platform
drwxr-xr-x 10 root wheel 320 Dec 18 15:10 iPhoneOS.platform
drwxr-xr-x 8 root wheel 256 Dec 18 15:10 iPhoneSimulator.platform
I looked at the names of the folders, which are seemingly simulator, aka virtual machine, for different Apple operating systems.
I am a stranger in Apple os development and share no interest in it. I only write c, java, python, html and all that with my Mac. Can I delete these unnecessary files? Or should I keep the MacOSX.platform at least?
–
–
Yes you can delete platforms from this folder
but make sure that you remove a platform and the simulator, otherwise Xcode will refuse to restart after
Example for Ios watch :
remove WatchOS.platform
and also WatchSimulator.platform
–
Don Mag advice is good.
I would not remove anything from the /Applications/Xcode.app folder as this could cause you issues running Xcode.
There is a folder in ~/Library/Developer though that stores downloaded version of the DeviceSupport for any version of iOS/tvOS/watchOS etc that you have been developing for. Every time an OS is updated another download appears in these folders and older version are not removed automatically.
Any of these can be removed as they will download again automatically the next time you build to an OS version. Though bear in mind the extra wait time needed on the first build of an uncache version.
I use an App from the App Store called 'DevCleaner' which allows me to select any DeviceSupport files, Archives (I tend to keep these) and Derived data. It's useful as it shows how much space each folder is taking up.
I select everything but the latest versions of the OSes I am developing for.
Hope that helps.
–
You can delete all simulators inside platform folder.
And you can delete all folder besides "developer" and ".plist" files inside any platform folder , such as:
Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform
Be careful, if you delete developer folder or some ".plist" files in any platform folder, Xcode will not be able to open.
My experience with deleting unneeded platforms is that it's fine if you have disabled SIP. I don't use Xcode, but it seems to work (I've tried building an example Macos app). Command line tools like Clang have no issues.
Note that the change breaks Xcode signature (check with codesign --verify
). This means it won't work when SIP (System Integrity Protection) is enabled:
> codesign --verify /Applications/Xcode.app/
/Applications/Xcode.app/: a sealed resource is missing or invalid
I suggest keeping at least MacOSX.platform
because it's required for building programs for Mac OS itself.
XCODE_PLATFORMS=/Applications/Xcode.app/Contents/Developer/Platforms
rm -rf "${XCODE_PLATFORMS}/AppleTVOS.platform"
rm -rf "${XCODE_PLATFORMS}/AppleTVSimulator.platform"
rm -rf "${XCODE_PLATFORMS}/WatchOS.platform"
rm -rf "${XCODE_PLATFORMS}/WatchSimulator.platform"
rm -rf "${XCODE_PLATFORMS}/iPhoneOS.platform"
rm -rf "${XCODE_PLATFORMS}/iPhoneSimulator.platform"
After running the above, I have only these SDKs:
> xcodebuild -showsdks
macOS SDKs:
DriverKit 19.0 -sdk driverkit.macosx19.0
macOS 10.15 -sdk macosx10.15
Note that all platforms are restored with every Xcode update.
If you go to any one of these .platform
folders, and under that go to:
Library/Developer/CoreSimulator/Profiles/Runtimes
and delete the file in there, as long as you don't use that simulator (in my case WatchOS), then it should be fine.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.