Mac OS Catalina: “invalid active developer path” error

After upgrading to Catalina, I encountered the error below. Seems Xcode was no longer available.


xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

Try the following in your terminal; otherwise, head to https://developer.apple.com/download/more/ and download Xcode manually.


xcode-select --install

How to add environment variables in Mac OS X

Adding here for reference (tried this in Mac OS X Mojave):


# To set an environment variable, enter the following command:
launchctl setenv variable "value"

# To find out if an environment variable is set, use the following command:
launchctl getenv variable

# To clear an environment variable, use the following command:
launchctl unsetenv variable

My .bash_profile

Don’t know why I never added it here, so doing it now.


alias ll="ls -al"
alias src="cd ~/workspace/"
alias ap="cd ~/workspace/git/antonperez/"

alias readyapi=”/Applications/ReadyAPI-2.5.0.app/Contents/java/app/bin/ready-api.sh”

performGitOperations() {
git fetch –all
git checkout $1
git reset –hard origin/$1
git clean -fd
}

copom() {
echo “[———- START ———-]”
if [ “$2” = “all” ]; then
echo “–>> blwebdriver <<–” cd ~/workspace/git/qa/blwebdriver performGitOperations $1 echo “–>> blutilities <<–” cd ~/workspace/git/qa/blutilities performGitOperations $1 fi echo “–>> blpages <<–” cd ~/workspace/git/qa/blpages performGitOperations $1 echo “–>> blcucumber <<–”
cd ~/workspace/git/qa/blcucumber
performGitOperations $1
echo “[———- DONE ———-]”
}

 

git-all() {
git fetch –all
git checkout $1
git reset –hard origin/$1
git clean -fd
}

if [ -f $(brew –prefix)/etc/bash_completion ]; then
. $(brew –prefix)/etc/bash_completion
fi

gitPS1(){
gitps1=$(git branch 2>/dev/null | grep ‘*’)
gitps1=”${gitps1:+ (${gitps1/#\* /})}”
echo “$gitps1”
}

PS1=’\u@\h:\w$(gitPS1)$ ‘

Install sqlcmd on Mac OS X

In case you need to run SQL Server scripts from your Mac, do the following to install (NOTE: I use HomeBrew.):

    • From the terminal, type:

brew tap microsoft/mssql-release https://github.com/Microsoft/homebrew-mssql-release
ACCEPT_EULA=y brew install --no-sandbox msodbcsql mssql-tools

    • You should see something like in the screenshot. Type “YES” if prompted and be on your way.
    • Once done, type:

sqlcmd