Last active
May 17, 2023 09:38
-
-
Save rudifa/0c91ab8e62de0fb135ec94808d27ad53 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# originally from | |
# https://gist.github.com/maciekish/66b6deaa7bc979d0a16c50784e16d697 | |
# rudifa: added TARGET logic and kill CoreSimulatorService | |
killall Xcode | |
pkill -int com.apple.CoreSimulator.CoreSimulatorService | |
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" | |
rm -rf ~/Library/Developer/Xcode/DerivedData/* | |
rm -rf ~/Library/Caches/com.apple.dt.Xcode/* | |
TARGET=(*.xcworkspace) | |
if [ $TARGET == "*.xcworkspace" ]; then | |
TARGET=(*.xcodeproj) | |
if [ $TARGET == "*.xcodeproj" ]; then | |
TARGET="" | |
fi | |
fi | |
if [ $TARGET != "" ]; then | |
open -a "/Applications/Xcode.app" "$TARGET" | |
else | |
echo *** no Xcode workspace or project found | |
fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment