Xcode Command PhaseScriptExecution Failed

解決 Unity 在 Windows 環境輸出 XCode 專案後,在 Mac 進行建置時出現「Command PhaseScriptExecution failed with a nonzero exit code」錯誤的問題。本文記錄使用 Unity 2022 搭配 Google Cardboard 時的發生條件,以及改在 macOS 上輸出 XCode 專案的根本解法,並整理升級 Pod、修改 Build Phases 等測試過但無效的方法。

前言

在 Windwos 環境使用 Unity 輸出 XCode,之後使用 Mac 測試、上傳,出現了錯誤。

Command PhaseScriptExecution failed with a nonzero exit code

img

解決方式

因為專案有使用 Cardboard,且 Unity 是使用 2022,才會出現此問題,之前使用 2021 輸出上架都沒問題。

我的解決方法是把專案改成在 MacOS 上輸出就能完美解決此問題。

測試過的方法

有測試過的方法,可是對我這次情況沒有效果。

  • 升級或安裝 Pod。參考
  • 修改 build phases 開啟 For install builds only。參考
  • 修改 Workspace Setting 的 Build System,在 Xcode 14 無法修改。參考

2026年5月30日 星期六
comments powered by Disqus
Wenrong Nexus