-
-
Save thefotes/0021479be7e55d713a50198a188b252f to your computer and use it in GitHub Desktop.
#!/bin/bash | |
set -e | |
xcodeproj=`find . -maxdepth 1 -name "*.xcodeproj"` | |
proj_name=`echo $xcodeproj | sed 's/.\///g' | sed 's/.xcodeproj//g'` | |
xcworkspace=`find . -maxdepth 1 -name "$proj_name.xcworkspace"` | |
if [[ ! -z $xcworkspace && -e $xcworkspace ]]; then | |
open $xcworkspace | |
else | |
open $xcodeproj | |
fi |
My experience in used xed
is that its slower, sometimes much slower, than using this script. Thats mainly anecdotal as I don't have pure quantitative data to back up the claim, but if I run them both xop
is faster for me.
Id be interested in hearing whether or not you can reproduce this by using this script + xed on the same project.
Thanks for the info, xed
has been pretty fast for me. My big issue is that if it can't find something to open it gets slow, pops an alert within Xcode, and the exits cleanly (instead of exiting with an error code). I ended up rolling my own script as well.
Thanks for the info,
xed
has been pretty fast for me. My big issue is that if it can't find something to open it gets slow, pops an alert within Xcode, and the exits cleanly (instead of exiting with an error code). I ended up rolling my own script as well.
Right on 🤙
In case you haven't heard of it, there's a utility shipped with Xcode that does this and more called
xed
I just found out about. In my testing, it seems to handle opening single files, projects, workspaces (even when a project and workspace are in the same directory), playgrounds in the directory, and swift packages. (tested onxed
version 11.4)The only downside is that it's not very graceful when it can't find something to open.