5

I understand that you can change a LaunchAgent's working directory with a WorkingDirectory key, but is there any way to set the Working Directory to a user's home directory reliably and portably within the plist? Can I do something like:

<key>WorkingDirectory</key>
    <string>~</string>

and have it work?

0
2

launchd doesn't know about shell mechansims like ~ or $HOME. Instead you can use one of the following

  • Specify the full path in the plist
  • Add cd $HOME at the beginning of the executedscript

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .