Created
March 9, 2017 22:08
-
-
Save anuragajwani/90d088de14ea550c564772b8b21b539c 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 | |
realpath() { | |
[[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}" | |
} | |
FILE_PATH=$(realpath $0) | |
# File directory path | |
DIR_NAME=$(dirname "${FILE_PATH}") | |
# Xcode process id | |
XCODE_PID=$(pgrep Xcode) | |
if [ ! -z "$XCODE_PID" ]; then | |
kill $XCODE_PID | |
else | |
echo "XCode was not running" | |
fi | |
# Remove derived data | |
rm -rf ~/Library/Developer/Xcode/DerivedData | |
# Remove pod generated content | |
cd ${DIR_NAME} | |
cd .. # Move to project root or where your Podfile lives | |
rm -rf Pods | |
rm Podfile.lock | |
XCWORKSPACE=$(find . -name "*.xcworkspace") | |
rm -rf ${XCWORKSPACE} | |
pod install | |
open -a Xcode ${XCWORKSPACE} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment