Rather than relying on $PATH
, the value of which isn't obvious, use the whole path to ios-sim
.
Edit your custom script and change:
ios-sim launch ...
to
/usr/local/bin/ios-sim launch ...
The reason why using $PATH
can be dangerous (perhaps too strong a word) is that it's not obvious where it's set. For example Xcode will use the path that's configured in /etc/launchd.conf
and /usr/local/bin
might have been added in /etc/profile
or ~/.bash_profile
.
- Will
launchd
use the value in/etc/profile
and thereby pass it to Xcode to use? - Will scripts started by Xcode use
/etc/profile
or~/.bash_profile
?
It's complicated and thorough understanding of this environment will doubtless allow you to invoke your command via $PATH
, however using the fullpath to a command is a simple approach which will always work.