I made an app by following these steps
- Make folder
Foo.app
- Make Subfolder
Contents
Put
Info.Plist
inContents
with... <key>CFBundleExecutable</key> <string>Foo</string> ...
Make
MacOS/Foo
as an executable shell script
Foo
looks like
#!/bin/sh
echo $0 > /Users/me/temp/foo1
pwd > /Users/me/temp/foo2
export > /Users/me/temp/foo3
Clicking on the app in the finder then checking the results. The results are, foo1 is empty, foo2 is just /
and foo3 looks like
export Apple_PubSub_Socket_Render="/private/tmp/com.apple.launchd.FgQwJ5EVCp/Render"
export HOME="/Users/me"
export LOGNAME="me"
export OLDPWD
export PATH="/usr/bin:/bin:/usr/sbin:/sbin"
export PWD="/"
export SHELL="/bin/zsh"
export SHLVL="1"
export SSH_AUTH_SOCK="/private/tmp/com.apple.launchd.4hbrl5p8fp/Listeners"
export TMPDIR="/var/folders/7h/wyw4jhd933z5jmqzsdx6r0sr0000gn/T/"
export USER="me"
export __CF_USER_TEXT_ENCODING="0x1F5:0x0:0x0"
No references to /Applications/Foo.app
anywhere
Now do I get the path to my app in the launch script?