Is there a way to remove the authorization prompt from command-line instances of Instruments (Xcode)?

Okay I think I got it working.

Here are some more details about how to remove xcode command line authorization prompt

What I did was the following:

  • Mark jenkins user as admin (unfortunately it seems that there is no other way atm)
  • Go to /etc/authorization
  • search for key system.privilige.taskport
  • change value of allow-root to true

    <key>system.privilege.taskport</key>
    <dict>
        <key>allow-root</key>
        <false/> // change to -> <true>
        <key>class</key>
        <string>user</string>
        <key>comment</key>
        <string>Used by task_for_pid(...).
        ...
    </dict>
    

Now I am being able to use jenkins to run my UIAutomation-Tests via Command Line Script


Here's a wonderful command that may work for you:

security unlock-keychain -p [password] "${HOME}/Library/Keychains/login.keychain"

It's the command-line way to gain access to a keychain on the Mac. I haven't tested it with Automation, but it's how I've integrated my iOS builds with Jenkins.

(Replace [password] with the password)


Adding to Alexander's answer, I found that for Mavericks, because of the way authorizations are handled (source), you should do this:

sudo security authorizationdb write system.privilege.taskport allow

I am running zucchini functional tests through a Jenkins job in a VMWare VM, and the slave couldn't launch properly the simulator and would hang on the splash screen, probably because of incorrect authorisations. This helped me solve this issue, hope it helps others.