I am currently using Instruments via a bash script to initiate the command-line interface to start up runs of the Automation plug-in.
With 4.2, this worked well en
I tried security unlock-keychain and editing the /etc/authorization file, but neither of those worked.
In the end the only thing that removed that security prompt was what jacekmigacz suggested in a comment, to run "sudo DevToolsSecurity --enable".
I also faced with this issue on El Capitan. I found this article very helpful https://www.dssw.co.uk/reference/authorization-rights/. Based on it I changed following rights in order to overcome this issue:
system.privilege.taskport
system.privilege.taskport.debug
system.privilege.taskport.safe
com.apple.dt.instruments.process.analysis
com.apple.dt.instruments.process.kill
The user your script runs as has to be authorized to use the developer tools. You can do this two ways:
Add the user to the _developer
group:
sudo dscl . append /Groups/_developer GroupMembership scriptusername
Use the DevToolsSecurity command line tool
Keep in mind that for the UIAutomation instruments to work properly, the user you are invoking Instruments from will also need to be a user that can start a window server (i.e. run the UI) - and will have to be logged in to a window server when UIAutomation runs.
These two things are two of the four or five secrets to using UIAutomation with Jenkins.
sudo security authorize -u [username]
worked for me.
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.
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)