'Delete Xcode and download again instead of making update?
I'm using Xcode 12.5 (12E262) on a MacBook Air with macOS Big Sur 11.5.1 (20G80).
App Store says, there's a new update for Xcode.
When trying to start the update, I get a message that the update cannot get started because there isn't enough disk space.
Can I simply delete my current version of Xcode and then download the version from the App Store? Because this will allow me to have enough disk space.
Or will this delete preferences or something else?
Solution 1:[1]
Yes, you can remove the current Xcode and install a new version from Mac App Store. However, you will probably encounter the same error for insufficient disk space, as it requires more than 40GB free space to expand and install Xcode.
To solve your problem, you can download Xcode from Apple Developer Portal and extract the XIP file in an external drive (of course you still need sufficient space). Then, move the extracted Xcode app back to your Mac's Applications folder.
Also, before you try the method above, you can use a software called DevCleaner, which can clean the unused simulator files, logs and derived data in your Mac.
Last, if you are brave enough, you can use this script to wipe clean your Xcode traces in your Mac (I personally use this to free up spaces when installing a new version):
killall Xcode
xcrun -k
xcodebuild -alltargets clean
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache"
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang.$(whoami)/ModuleCache"
sudo rm -rf /Applications/Xcode.app
rm -rf ~/Library/Caches/com.apple.dt.Xcode
rm -rf ~/Library/Developer
rm -rf ~/Library/MobileDevice
rm -rf ~/Library/Preferences/com.apple.dt.Xcode.plist
rm -rf ~/Library/Preferences/com.apple.dt.xcodebuild.plist
sudo rm -rf /Library/Preferences/com.apple.dt.Xcode.plist
sudo rm -rf /System/Library/Receipts/com.apple.pkg.XcodeExtensionSupport.bom
sudo rm -rf /System/Library/Receipts/com.apple.pkg.XcodeExtensionSupport.plist
sudo rm -rf /System/Library/Receipts/com.apple.pkg.XcodeSystemResources.bom
sudo rm -rf /System/Library/Receipts/com.apple.pkg.XcodeSystemResources.plist
sudo rm -rf /private/var/db/receipts/com.apple.pkg.Xcode.bom
save the file as uninstall_xcode.sh
and run it from Terminal. Admin rights required.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 |