Xcode 15:cp - 不允许操作

Pom*_*ule 3 shell xcode

我的项目不会在 Xcode 15 上构建。这种情况在我的本地计算机和 Xcode Cloud 上都发生。

我有一个构建阶段脚本,用于在从 CI 获取应用程序机密后将其写入磁盘。这是我的脚本:

target_file="./MyProject/SupportingFiles/Secrets.json"

if [[ $CONFIGURATION == "Debug Development" || $CONFIGURATION == "Release Development" ]]; then
cp "./MyProject/SupportingFiles/SecretsDev.json" "$target_file"
echo "Wrote Dev secrets."
elif [[ $CONFIGURATION == "Debug Production" || $CONFIGURATION == "Release Production" ]]; then
cp "./MyProject/SupportingFiles/SecretsProd.json" "$target_file"
echo "Wrote Prod secrets."
fi
Run Code Online (Sandbox Code Playgroud)

但是当我构建项目时,我在构建日志中看到以下错误:

cp: ./MyProject/SupportingFiles/SecretsDev.json: Operation not permitted
Wrote Dev secrets.
Run Code Online (Sandbox Code Playgroud)

看起来由于某种原因,Xcode 15 现在强制执行某种磁盘访问限制。

我该怎么做才能让这个脚本在 Xcode 15 中以既能在我的机器上又能在 Xcode Cloud 上运行的方式运行?

先感谢您。