title: postbuild UIAutomation script not running in jenkins
body: <p>I am trying to do <em>End-to-End automation</em> for an <strong>iOS project</strong>. My aim is to automate the <em>continuous integration</em> process with attaching <code>UIAutomation</code> scripts as post build action. 
  So from the time when a user do check his code in SVN and till we get test result of automation, everything will be automated.</p>
  
  <p><code>Jenkins</code> is installed on my local machine and running on <code>localhost</code>.<br>
  Now I have automated build process through <code>jenkins</code> and at other end I have my shell script ready which will run <code>UIAutomation</code> java scripts on build output.<br>
  When I use my shell script as post build action then I get error in running instrument command(written inside shell script) but if I run this script manually through terminal then it works fine.</p>
  
  <pre><code>instruments[64703:60f] -[NSAlert alertWithError:] called with nil NSError. A generic error message will be displayed, but the user deserves better.
  _RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL. Mon Feb  6 13:15:20 inpunml310743 instruments[64703] &lt;Error&gt;: kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged. 2012-02-06 13:15:20.179 instruments[64703:60f] Recording cancelled : At least one target failed to launch; aborting run Instruments Trace Error : Failed to start trace. Build step 'Execute shell' marked build as failure Finished: FAILURE
  </code></pre>
  
  <p>then i tried this command with sudo then I got following error
  <strong>sudo: no tty present and no askpass program specified</strong></p>
  
  <p>Please let me know how can I run these commands successful, only this step is left in my task. </p>