I have installed Xcode in my machine in order to use it for desktop development (OS X/Cocoa/Command line tools). Whenever I create a new project, there are templates in the wizard for iOS, watchOS and tvOS development, but at this moment I have no interest in these SDKs.
Since Xcode.app is taking a lot of space in my disk even after a fresh install, is it possible to remove these SDKs and reclaim some space?
I found out how to do this. I don't know at this moment if this can have any side-effect on other components for Xcode that could fail. In that case it may be possible to reinstall it from the Mac AppStore again.
Xcode packages the SDKs for these different products as Platforms. There is a Platform for macOS, a Platform for iOS, and so on. All these Platforms are stored in this folder:
/Applications/Xcode.app/Contents/Developer/Platforms
It seems it's possible to actually remove platforms by deleting the correspondent folders inside, such as:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform
/Applications/Xcode.app/Contents/Developer/Platforms/WatchOS.platform
/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform
Whenever one or more of these folders are deleted, the New Project wizard won't even show them anymore as categories.
Above in incorrect. You will have to reinstall Xcode if you delete any of these folders. /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform I deleted above Xcode wanted me to reinstall.
Try to delete all folders besides "developer" inside platform folders.
Example, delete all beside this:
/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/developer.
Other folders in that area you can delete
Related
My ~/Library/Developer/Xcode folder is over 17 gigs in size. As I work in virtual machine (Parallels 12) with a 64 gig limit in total virtual disk size, I need to recover some disk space.
Amongst the folders such as:
Archives
DerivedData
Installs
iOS Device Logs
iOS DeviceSupport
Snapshots
UserData
What might I be able to delete without ruining my project?
Under Archives you can delete anything you want but you should keep recent builds. And you should backup older builds you might need to access in the future.
You can delete everything under DerivedData. Next time you build a project, the needed files will be recreated.
My Installs folder only contains a set of empty folders and the newest if over 3 years old. Check yours, that may be safe to delete.
The iOS Device Logs folder contains old device logs for various versions of iOS. You can safely delete any of the older logs.
The iOS DeviceSupport folder contains a folder for each version of iOS you ever had on an iOS device you ever connected while Xcode was running. Feel free to delete any folders for versions of iOS you don't support anymore. For example, if none of your apps have a Deployment Target older than iOS 8.1, for example, you can safely delete any folder for iOS 8.0.x and earlier. These folders are only needed to symbolicate crash reports.
The Snapshots folder is used by Xcode to save snapshots (backups). You can delete snapshots for old projects you don't care about.
I'd leave the UserData folder alone.
Here is explantation for each folder and what you can delete to reduce the size.
DeviceSupport - You can keep the simulator which log's you may need in future. It's symbolicate crash logs for different device/iOS.
Delete this folder after every few days interval. Most of the time, it occupy huge space!
~/Library/Developer/Xcode/DerivedData
All your targets are kept in the archived form in Archives folder. Before you decide to delete contents of this folder, here is a warning - if you want to be able to debug deployed versions of your App, you shouldn’t delete the archives. Xcode will manage of archives and creates new file when new build is archived.
~/Library/Developer/Xcode/Archives
iOS Device Support folder creates a subfolder with the device version as an identifier when you attach the device. Most of the time it’s just old stuff. Keep the latest version and rest of them can be deleted (if you don’t have an app that runs on 5.1.1, there’s no reason to keep the 5.1.1 directory/directories). If you really don't need these, delete. But we should keep a few although we test app from device mostly.
~/Library/Developer/Xcode/iOS DeviceSupport
Core Simulator folder is familiar for many Xcode users. It’s simulator’s territory; that's where it stores app data. It’s obvious that you can toss the older version simulator folder/folders if you no longer support your apps for those versions. As it is user data, no big issue if you delete it completely but it’s safer to use ‘Reset Content and Settings’ option from the menu to delete all of your app data in a Simulator.
~/Library/Developer/CoreSimulator
(Here's a handy shell command for step 5: xcrun simctl delete unavailable)
Caches are always safe to delete since they will be recreated as necessary. This isn’t a directory; it’s a file of kind Xcode Project. Delete away!
~/Library/Caches/com.apple.dt.Xcode
I realise that there are a few questions/answers and I also realise that I can download via the developer page, however it says 7.3 is installed ...
but when you start Xcode it is still the previous version.
Is there a work around or do you have to download a fresh copy? With a very slow connection I would rather avoid it.
Sadly you are going to have to download a fresh copy of Xcode. Same thing happened to me and I tried everything. Restarting my computer, closing it in Force quit applications and tons more and nothing worked. Fresh install would be the only option for you.
Check that you don't have any backup drives/clones/time machines etc connected, and that you only have the one MAS Xcode version installed (you can check if it's a MAS version by going to /Applications or wherever, and opening the Xcode folder with Show Package Contents, then looking in the Contents folder for a _MASReceipt folder. If that's there, it's a MAS version).
The MAS app has an issue where it will update the app on backup drives etc that are connected to your machine when you do the update, often before it updates the version you expect it to update (in /Applications). This could mean it may need to do a few updates before it gets to the one you're actually using.
If you like to keep old versions of Xcode around, always delete the _MASReceipt folder from the old ones. That will prevent the MAS app from upgrading them later.
After going through and cleaning my disk with old things that I didn't need anymore, I came across the iOS DeviceSupport folder in ~/Library/Developer/Xcode which was taking nearly 20 GB.
A similar question has been asked before, but since then many things have changed and I would like an up-to-date answer.
As long as I have the version I use for testing, can I delete the older/unused versions without breaking anything?
The ~/Library/Developer/Xcode/iOS DeviceSupport folder is basically only needed to symbolicate crash logs.
You could completely purge the entire folder. Of course the next time you connect one of your devices, Xcode would redownload the symbol data from the device.
I clean out that folder once a year or so by deleting folders for versions of iOS I no longer support or expect to ever have to symbolicate a crash log for.
More Suggestive answer supporting rmaddy's answer as our primary purpose is to delete unnecessary file and folder:
Delete this folder after every few days interval. Most of the time, it occupy huge space!
~/Library/Developer/Xcode/DerivedData
All your targets are kept in the archived form in Archives folder. Before you decide to delete contents of this folder, here is a warning - if you want to be able to debug deployed versions of your App, you shouldn’t delete the archives. Xcode will manage of archives and creates new file when new build is archived.
~/Library/Developer/Xcode/Archives
iOS Device Support folder creates a subfolder with the device version as an identifier when you attach the device. Most of the time it’s just old stuff. Keep the latest version and rest of them can be deleted (if you don’t have an app that runs on 5.1.1, there’s no reason to keep the 5.1.1 directory/directories). If you really don't need these, delete. But we should keep a few although we test app from device mostly.
~/Library/Developer/Xcode/iOS DeviceSupport
Core Simulator folder is familiar for many Xcode users. It’s simulator’s territory; that's where it stores app data. It’s obvious that you can toss the older version simulator folder/folders if you no longer support your apps for those versions. As it is user data, no big issue if you delete it completely but it’s safer to use ‘Reset Content and Settings’ option from the menu to delete all of your app data in a Simulator.
~/Library/Developer/CoreSimulator
(Here's a handy shell command for step 5: xcrun simctl delete unavailable )
Caches are always safe to delete since they will be recreated as necessary. This isn’t a directory; it’s a file of kind Xcode Project. Delete away!
~/Library/Caches/com.apple.dt.Xcode
Additionally, Apple iOS device automatically syncs specific files and settings to your Mac every time they are connected to your Mac machine. To be on safe side, it’s wise to use Devices pane of iTunes preferences to delete older backups; you should be retaining your most recent back-ups off course.
~/Library/Application Support/MobileSync/Backup
Source: https://ajithrnayak.com/post/95441624221/xcode-users-can-free-up-space-on-your-mac
I got back about 40GB!
I wrote a small command-line utility based on the great answer by #JamshedAlam for those who are tired of deleting the contents of those folders manually. Check it out here if you think it would help you.
Yes, you can delete data from iOS device support by the symbols of the operating system, one for each version for each architecture. It's used for debugging.
If you don't need to support those devices any more, you can delete the directory without ill effect
I exedentaly deleted my xCode project, but I still have app installed on my iPhone. Is it somehow possible to retrieve at least some part of original project files from app itself?
No, it's not possible to do this.
You may be able to recover the original archive file created prior to installation on your device from inside the following directory (depending on how you deleted the original project) which may be of help.
~/Library/Developer/Xcode/Archives/
I am familiar with windows driver developing (WinDDK) but recently changed to Xcode for mac and now I am absolutely newbie in this field.
I am trying to make a sample project from Apple tutorial from here:
https://developer.apple.com/library/mac/#documentation/Darwin/Conceptual/KEXTConcept/KEXTConceptIOKit/iokit_tutorial.html
I have added all settings and now it is turn to make kextlibs try but I can't find any Build folder or driver.
In fact when writing other programs in Xcode , I can run them successfully in simulator but never could make a .dmg file to use without the simulator. Am I missing something?
There should be a 'Products' group in your XCode project's file tree. It should contain your .kext bundle. If you right-click that after a successful build, you can select "Show in Finder". Unlike earlier versions, XCode 4 places build products in a folder somewhere under ~/Library/ - it's not exactly easy to find by hand.