有没有办法从Instruments(XCode)的命令行实例中删除授权提示? [英] Is there a way to remove the authorization prompt from command-line instances of Instruments (XCode)?
问题描述
我目前正在通过bash脚本使用Instruments来启动命令行界面以启动Automation插件的运行。
I am currently using Instruments via a bash script to initiate the command-line interface to start up runs of the Automation plug-in.
使用4.2,这个工作得很好,但是升级到Xcode 4.3后,我现在被提示让授权用户分析其他进程。即使授予了正确的凭据,也不会对用户进行实际身份验证。我收到以下错误:
With 4.2, this worked well enough, however with the upgrade to Xcode 4.3, I am now being prompted for an authorized user to 'analyze other processes'. No user is ever actually authenticated, even if the correct credentials are granted. I get the following error:
Failed to authorize rights (0x20) with status: -60007.
2012-02-27 19:30:37.232 instruments[54151:1c03] Failed to connect to local pid watcher service: (os/kern) failure
即使身份验证失败,自动化插件也会执行,但是这需要我的脚本让物理保姆输入凭据,这在很多方面都会破坏这些命令的目的线运行。是否可以将用户详细信息添加为参数?或者是否有其他方法可以跳过此提示而无需使用钥匙?
Even with the authentication failure, the Automation plug-in executes, however this requires my script to have a physical babysitter enter credentials, which in many ways defeats the purpose of these command-line runs. Is it possible to add the user details as arguments? Or is there some other way to skip over this prompt without requiring a person at the keys?
- 编辑 -
当你第一次尝试从GUI运行UIAutomation测试时,会出现这个授权对话框。
This authorization dialog appears when you try to run UIAutomation tests from the GUI for the first time.
- 编辑 -
一旦在GUI中回答了授权对话框,提示就会停止出现在命令行中。这种解决方法虽然看起来并不像'答案'那样有效。
Once the authorization dialog has been answered in the GUI, the prompts stop appearing on the command-line. This kind of work-around doesn't seem valid as an 'answer' though.
推荐答案
这是一个很棒的命令,可能有效为你:
Here's a wonderful command that may work for you:
security unlock-keychain -p [password] "${HOME}/Library/Keychains/login.keychain"
这是获取Mac上钥匙串访问权限的命令行方式。我没有使用自动化测试它,但这是我将我的iOS版本与Jenkins集成的方式。
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.
(用密码替换[密码] )
这篇关于有没有办法从Instruments(XCode)的命令行实例中删除授权提示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!