How can I use $HOME or ~/ in my log paths of launchd plist to run as LaunchAgent My plist has below keys:

&lt;key&gt;StandardOutPath&lt;/key&gt;
&lt;string&gt;$HOME/launchd.stdout.log&lt;/string&gt;
&lt;key&gt;StandardErrorPath&lt;/key&gt;
&lt;string&gt;$HOME/launchd.stderr.log&lt;/string&gt;


But it doesn't identify  $HOME. What I want is to load this plist in different user accounts as I cant hardcode my user name.

How can I achieve this ultimate aim?
You cannot use $HOME in these keys. You'll need to use the work-around shown in this answer:

how can I use $HOME, ~ or environment variable in plist file of LaunchDaemons

And then use ordinary shell scripting to redirect standard out and standard error to locations within $HOME. I.e. use a command similar to:

command &gt;$HOME/launchd.stdout.log 2&gt;$HOME/launchd.stderr.log