[Swift]pod install成功后运行项目报错问题error: Sandbox: bash(84760) deny(1)

操作:

bash 复制代码
platform :ios, '14.0'

target 'ZKMKAPP' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!

  # Pods for ZKMKAPP
  pod 'Moya'

end

pod install成功后运行报错

报错:

error: Sandbox: bash(84760) deny(1) file-write-create /Users/gamin/Documents/jiruan/ZKMKAPP/Pods/resources-to-copy-ZKMKAPP.txt (in target 'ZKMKAPP' from project 'ZKMKAPP')

/Users/gamin/Documents/jiruan/ZKMKAPP/Pods/Target Support Files/Pods-ZKMKAPP/Pods-ZKMKAPP-resources.sh: line 20: /Users/gamin/Documents/jiruan/ZKMKAPP/Pods/resources-to-copy-ZKMKAPP.txt: Operation not permitted

realpath: illegal option -- m

usage: realpath -q path ...

:20: error: Unexpected failure

解决:

在Xcode中,前往项目的"Build Settings"部分,将属性设置ENABLE_USER_SCRIPT_SANDBOXING设置为"No"。

相关:

在 Swift 或 Xcode 项目中,ENABLE_USER_SCRIPT_SANDBOXING 是一个用于控制 用户脚本沙盒化 的构建配置选项。它主要与 Xcode 的脚本执行环境有关,目的是提高构建脚本的安全性,防止脚本对系统或文件进行未经授权的操作。

ENABLE_USER_SCRIPT_SANDBOXING 默认值

  • Xcode 14 及以上版本 :
    • 默认值为 YES。
    • 用户脚本被限制在沙盒环境中运行。
  • Xcode 14 以下版本 :
    • 此选项默认不存在,脚本运行没有沙盒限制。
相关推荐
茶底世界之下2 天前
时间线效果层,为什么不能只复用一个处理器?
ios·swift
Cc.Y2 天前
Swift深度链接的极简之道
ios·cocoa·swift
传奇开心果编程2 天前
【SwiftUI提高练中学】第9课 安全与隐私
swiftui·移动开发·swift·编程语言理论·开发范式·编程框架·声明式ui
茶底世界之下3 天前
动态切换 nearest / linear 时,为什么不能只替换 sampler
ios·swift
应用市场3 天前
把旧 Pixel 变成相册备份中转站(上):Mac 到安卓的照片传输工具设计——流式上传、sha256 校验、adb forward 与 Bonjour
android·macos·adb·kotlin·swift
东坡肘子3 天前
Swift Server,又多了一个 Google -- 肘子的 Swift 周报 #156
人工智能·swiftui·swift
打工仔折腾 AI4 天前
从零写一个CAD 05:以鼠标为中心的滚轮缩放,招法能复用但顺序不能反
开发语言·后端·python·性能优化·计算机外设·swift·ai agent 实战
茶底世界之下4 天前
视频预览切换为何会闪回旧帧:用 generation + mode identity 管住异步回调
ios·swift
茶底世界之下4 天前
类型擦除之后,Metal 滤镜组合为什么不能只执行一个 Filter?
ios·swift