Launchctl says plist is invalid, plutil says it's OK I'm trying to have launchd run a shell script when I join a new WiFi network. I've created this plist file (closely based on this SuperUser answer) at /Users/myname/Library/LaunchAgents/my.networkChangeListener.plist:
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;!DOCTYPE plist PUBLIC &quot;-//Apple Computer//DTD PLIST 1.0//EN&quot; \
 &quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&quot;&gt;
&lt;dict&gt;
  &lt;key&gt;Label&lt;/key&gt;
  &lt;string&gt;my.networkChangeListener&lt;/string&gt;
  &lt;key&gt;LowPriorityIO&lt;/key&gt;
  &lt;true/&gt;
  &lt;key&gt;ProgramArguments&lt;/key&gt;
  &lt;array&gt;
&lt;string&gt;/Users/myname/bin/networkChangeListener/onNetworkChange.sh&lt;/string&gt;
  &lt;/array&gt;
  &lt;key&gt;WatchPaths&lt;/key&gt;
  &lt;array&gt;
    &lt;string&gt;/etc/resolv.conf&lt;/string&gt;
    &lt;string&gt;/Library/Preferences/SystemConfiguration/NetworkInterfaces.plist&lt;/string&gt;
    &lt;string&gt;/Library/Preferences/SystemConfiguration/com.apple.airport.preferences.plist&lt;/string&gt;
  &lt;/array&gt;
  &lt;key&gt;RunAtLoad&lt;/key&gt;
  &lt;true/&gt;
&lt;/dict&gt;
&lt;/plist&gt;

My user is the owner of the plist, and the group is &quot;staff&quot;.
When I try to load the file by running launchctl load ~/Library/LaunchAgents/my.networkChangeListener.plist, I get an error saying &quot;Invalid property list&quot;.
However, when I run plutil ~/Library/LaunchAgents/my.networkChangeListener.plist, it returns &quot;OK&quot;
What is the problem with my plist file? Is is something specific to launchd? I'm completely at a dead end for how to debug this.
The first few lines should be

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
&lt;plist version="1.0"&gt;
&lt;dict&gt;


Your file (as well as the one in the linked answer) is missing the &lt;plist version="1.0"&gt; part.