From 9461e6fff634b5afc70daabc7e3c5286e639dfe6 Mon Sep 17 00:00:00 2001 From: Jungpyo Hong Date: Thu, 27 May 2021 20:30:08 -0500 Subject: [PATCH] add clean xcode --- README.md | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/README.md b/README.md index 65dfe06..80e805d 100644 --- a/README.md +++ b/README.md @@ -956,6 +956,56 @@ Enable canvas option like this +## Clean All Xcode Build File + +This will be helful when you are running out of storage in your mac + +```script +# 1 +echo "Removing Derived Data..." +rm -rf ~/Library/Developer/Xcode/DerivedData/ + +# 2 +echo "Removing Device Support..." +rm -rf ~/Library/Developer/Xcode/iOS\ DeviceSupport +rm -rf ~/Library/Developer/Xcode/watchOS\ DeviceSupport +rm -rf ~/Library/Developer/Xcode/tvOS\ DeviceSupport + +# 3 +echo "Removing old simulators..." +xcrun simctl delete unavailable + +# 4 +echo "Removing caches..." +rm -rf ~/Library/Caches/com.apple.dt.Xcode +rm -rf ~/Library/Caches/org.carthage.CarthageKit + +# 5 +if command -v pod &> /dev/null +then + # 6 + pod cache clean --all +fi + +echo "Done!" +``` + +After writing, run it with this command + +```script +chmod u+x clean-xcode.sh +``` + +And then + +```script +./clean-xcode.sh +``` + +**This will cleans out derived data, device support, simulators and caches. So that once you execute it, You have to build your project AGAIN** + +For More Info, visit [here](https://www.raywenderlich.com/19998365-understanding-and-managing-xcode-space) + ## Write README.md [This](https://medium.com/@saumya.ranjan/how-to-write-a-readme-md-file-markdown-file-20cb7cbcd6f) will help you to write a README.md file more dynamically 👍