我最近升级到了10.7.3,当我登录后第一次尝试在模拟器中调试我的iOS项目时,系统会提示我以下两个警报:
我的用户是管理员用户。 我以前从未见过这些警报。 我怎样才能让他们停下来?
编辑
我已使用
_developer
验证我是 id -a
群组的成员。
启用开发者模式: 在终端中运行:
DevToolsSecurity -enable
根据 Zev Eisenberg 的回答,重新安装 Xcode 4.2.1 有效。 但是,使用以下差异修补
/etc/authorization
文件可能会更容易。
<key>system.privilege.taskport.debug</key>
<dict>
<key>allow-root</key>
<false/>
<key>class</key>
- <string>user</string>
+ <string>rule</string>
<key>comment</key>
<string>For use by Apple. WARNING: administrators are advised
not to modify this right.</string>
<key>default-button</key>
<dict>
...
</dict>
<key>default-prompt</key>
<dict>
...
</dict>
- <key>group</key>
- <string>_developer</string>
<key>shared</key>
<true/>
- <key>timeout</key>
- <integer>36000</integer>
+ <key>k-of-n</key>
+ <integer>1</integer>
+ <key>rule</key>
+ <array>
+ <string>is-admin</string>
+ <string>is-developer</string>
+ <string>authenticate-developer</string>
+ </array>
</dict>
我使用 macOS Ventura 并接收
sudo dscl . append /Groups/_developer GroupMembership <username>
根据https://stackoverflow.com/a/1837935/5506988
sudo /usr/sbin/DevToolsSecurity --enable
表示已启用。
输入用户名和密码后,它可以工作,但每次启动调试器时我都必须执行此操作。
如果我运行
sudo security authorizationdb write system.privilege.taskport allow
,它会阻止提示,但仅限于下次重新启动。
我尝试遵循要求您更新的现有答案
/etc/authorization
- 自 macOS mavericks 以来已弃用,现在是 /System/Library/Security/authorization.plist
但我无法编辑此文件(我什至尝试过 this),但自从我的 $USER
不是文件的所有者,所以即使使用 sudo 我也无法强制覆盖它。
我试过了
sudo /usr/libexec/PlistBuddy -c "Set :rights:system.privilege.taskport:class allow" authorization.plist
但是,当然,这同样适用,但会默默地失败。
如果我运行
id -a
,它会返回 204(_developer)
,因此即使在运行 dcsl
命令之前我也是开发人员组的一员
为我解决的问题是
sudo dscl . append /Groups/_developer GroupMembership <username>
升级到 10.7.3 后重新安装 Xcode 4.2.1 似乎已经为我解决了这个问题。
我修改了
system.privilege.taskport
的规则,警报不再显示。
/etc/authorization
。system.privilege.taskport
。在 <key>class</key>
行下,将 <string>rule</string>
更改为 <string>allow</string>
我的 mac 10.12.5 和 Xcode9 也遇到同样的问题 运行这个命令:
sudo security authorizationdb write system.privilege.taskport allow
然后输入您的密码。检查它是否仍然提示您。 祝你好运..
我刚刚在(编辑方案)中关闭了调试 - >取消选中调试可执行文件。 但我也在另一个控制台上进行所有调试,因此如果您正在开发并且需要调试器,那么它不会有帮助。我只在旧版本的 Xcode 8.2.1 上遇到此问题,因为我使用 El Capitan 在旧 Mac 上运行代码。
较新的 mac 和 Xcode 版本 10 似乎没有这个问题。
文件 /etc/authorization 上的某些内容已被修改,我有一个没有 v10.7.3 的 Lion,它具有以下代码
5807-5814号线
<key>k-of-n</key>
<integer>1</integer>
<key>rule</key>
<array>
<string>is-admin</string>
<string>is-developer</string>
<string>authenticate-developer</string>
</array>
更新后,由于支持新语言,文件包含许多修改,但与调试授权对应的行与上面显示的行不同
7675-7676号线
<key>group</key>
<string>_developer</string>
我无法将这些差异应用到我的 10.7.3 Lion 安装中,因为它是生产机器,我不能冒险损坏它
我拥有命令所示的所有必要权限
id -a
uid=501(dave) gid=20(staff) groups=20(staff),
401(com.apple.access_screensharing),
402(com.apple.sharepoint.group.1),
12(everyone),
33(_appstore),
61(localaccounts),
79(_appserverusr),
80(admin),
81(_appserveradm),
98(_lpadmin),
100(_lpoperator),
204(_developer)
无需代码。无需重新安装xcode。执行以下步骤:
1.关闭xcode。
2.打开钥匙串访问。
3.双击你的钥匙串(从keychain.p12创建的钥匙图标)
4.进入访问控制面板(名称可能不正确)
5.启用所有应用程序访问此功能。
6.保存。
7.运行你的 xcode 项目。
8.效果很好。