You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何从Release构建中移除com.apple.security.get-task-allow权限?

解决Release构建移除com.apple.security.get-task-allow权限的方法
  • 检查项目Entitlements文件配置

    1. 打开Xcode项目,找到Entitlements.plist文件(没有的话右键项目→New File→搜索"Property List",命名为Entitlements.plist)
    2. 找到com.apple.security.get-task-allow键值对,右键选择"Add Conditional Value"
    3. 给Debug配置设值为YES,Release配置设值为NO
    4. 如果是通过Signing & Capabilities面板添加的权限,点击权限旁的"Info"按钮,只勾选Debug配置,取消Release的勾选
  • 确认Build Settings里的Entitlements路径

    1. 进入项目Build Settings,搜索Code Signing Entitlements
    2. 确保Debug和Release配置都正确指向你的Entitlements.plist路径(比如$(SRCROOT)/YourProjectName/Entitlements.plist)
    3. 要是不同配置用不同Entitlements文件,得分别设置,保证Release对应的文件里没有这个权限或者值为NO
  • 清理缓存重新构建

    1. 执行Product -> Clean Build Folder(快捷键Shift+Command+K)
    2. 删除DerivedData目录(就是你命令里的/Users/user/Library/Developer/Xcode/DerivedData/LABService-emdoarcsbzcuepbrkkkpbcckcaqx)
    3. 重新用Release配置构建,之后再用以下命令验证:
      codesign -d --entitlements - --xml /Users/user/Library/Developer/Xcode/DerivedData/LABService-emdoarcsbzcuepbrkkkpbcckcaqx/Build/Products/Release/MyAppName
      

内容的提问来源于stack exchange,提问作者c00000fd

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.24 01:28:13