title: Are there any conditions when launchctl fails to run or load a plist?
body: <p>Sometimes  I see that firing the command doesn't load the app at all. This happens rarely but are there any known conditions or situations where this command would fail? Is there any way to debug launchctl?</p>
  
  <pre><code>launchctl load /Library/LaunchAgents/com.xyz.plist
  </code></pre>
  
  <p>The contents of the plist are:</p>
  
  <pre><code>&lt;dict&gt;
  &lt;key&gt;Label&lt;/key&gt;
  &lt;string&gt;com.xyz&lt;/string&gt;
  &lt;key&gt;ProgramArguments&lt;/key&gt;
  &lt;array&gt;
      &lt;string&gt;/Applications/xyz.app/Contents/MacOS/xyz&lt;/string&gt;
  &lt;/array&gt;
  &lt;key&gt;EnvironmentVariables&lt;/key&gt;
  &lt;dict&gt;
      &lt;key&gt;OPT&lt;/key&gt;
      &lt;string&gt;xyz&lt;/string&gt;
  &lt;/dict&gt;
  &lt;key&gt;ExitTimeOut&lt;/key&gt;
  &lt;integer&gt;10&lt;/integer&gt;
  &lt;key&gt;KeepAlive&lt;/key&gt;
  &lt;dict&gt;
      &lt;key&gt;SuccessfulExit&lt;/key&gt;
      &lt;false/&gt;
  &lt;/dict&gt;
  &lt;key&gt;RunAtLoad&lt;/key&gt;
  &lt;true/&gt;
  &lt;key&gt;EnableTransactions&lt;/key&gt;
  &lt;false/&gt;
  </code></pre>
  
  <p></p>
  
  <p><code>launchctl dumpstate</code> shows STATE=WAITING. Why?</p>
  
  <p>Any help will be appreciable.</p>