Open Xcode workspace from zsh
Here's a simple zsh function that will open a Xcode project's workspace. It will gracefully fall back to the project if there is no workspace.
function xcopen {
files=$(ls $1.xcworkspace/ 2> /dev/null | wc -l | tr -d ' ')
if [ "$files" != "0" ]; then
open $1.xcworkspace/
else
open $1.xcodeproj/
fi
}
Usage: Change the project folder and type:
xcopen <Project Name>
Written by Neil Cowburn
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Zsh
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#