I noticed my current bash file has export PATH=$PATH:/Applications/MAMP/library/bin
which i put there to set up terminal access to mamp. I\'ve been trying to compi
Old thread, but I just recently researched if there's a way to open Xcode from the terminal myself, and was not satisfied when discovering the overly verbose $ open -a Xcode projname.xcodeproj
command. You could alias half the command like Arian Faurtosh's answer, but if you're going to edit a bash script, a function can serve you much better.
My solution:
# Function to open Xcode projects from the command line, call with $ xcode
function xcode {
proj=$(ls -d *.xcodeproj/ 2>/dev/null)
if [ -n "$proj" ]; then
# Omit -beta if you're not using beta version
open -a Xcode-beta "$proj"
else
echo "No Xcode project detected."
fi
}
Save above code to whatever file your shell sources each session. Now you can use $ xcode
and it will launch Xcode as long as your current directory contains a .xcodeproj dir.