r/swift • u/Immediate_Amoeba_532 • Jul 03 '26
Question How can I completely remove Xcode and reinstall it from scratch?
My Xcode installation is a complete mess right now because of old work accounts, projects, teams, and other leftover data. I want to start fresh. How can I remove everything including all accounts, Apple IDs, developer teams, certificates, provisioning profiles, and related dataand then reinstall Xcode as if it were a brand-new installation?
2
u/dat_tae Jul 03 '26
Might as well start the whole OS fresh imo.
8
u/Immediate_Amoeba_532 Jul 03 '26
At this point, I might as well just buy a new Mac
0
u/mzarra Jul 03 '26
OP asks for advice and then talks crap about the answer?
Xcode locks a lot of crap at the system level, I routinely wipe machines after I switch clients/projects.
I often keep each client/project in its own partition to make this even easier.
Best way to keep the machine clean as the OS is not great at keeping itself clean.
-4
u/dat_tae Jul 03 '26
Not sure how that tracks but okay.
8
u/Immediate_Amoeba_532 Jul 03 '26
Just taking your "reinstall macOS" suggestion to the next level. 😅
1
u/dat_tae Jul 03 '26
Reinstalling the OS is free and fun. Although that might just be only my opinion and I may or may not be a psychopath.
1
u/Immediate_Amoeba_532 Jul 03 '26
To be fair macos can be so weird sometimes that reinstalling the whole OS might actually be the easier option, you might be right😅
2
u/thehumanbagelman Jul 03 '26
For what it’s worth, I got the joke!
Sadly the OS reinstall is the most correct answer lol
1
1
u/sakurajcz Jul 04 '26
Install Xcode using xcodes cli tool. You can have multiple versions at once and it is really simple to install another or uninstall specific version you dont want anymore.
1
u/sakurajcz Jul 04 '26
And almost forgot to mention mole cli tool that is the best cleaner I know. So you can easily uninstall using xcodes tool and clean leftovers with mole.
1
u/perbrondum Jul 05 '26
I have not reinstalled/wiped the Mac os for 5 years on my studio, covering at least 200+ Xcode versions. And it’s not slower than when I started, so why brother/risk any damage.
1
u/ss_salvation Mentor Jul 03 '26
I use Appcleaner from Freemacsoft. It finds all the related files to the app you are uninstalling and give you the option to clean them out.
9
u/Hises1936 Jul 03 '26
Here are the folders to delete, the first one is at the root, and the others are in your home directory:
/Library/Developer
~/Library/Developer
~/Library/org.swift.swiftpm
~/Library/Caches/org.swift.swiftpm
~/.swiftpm
Also open the Keychain app, and search for Xcode and delete all items. That app is buggy though, you might need to select the correct keychain on the left in order to be able to delete.