xcodexcode13.3

Build phase in Xcode 13.3 started failing


I have a build phase that calls some python scripts.

This has been working fine for well over 2 years, but after recently updating to Xcode 13.3 it now fails.

Build phase script calling python with a .py file

the error I started receiving is:

/Users/me/Library/Developer/Xcode/DerivedData/MyApp-fsowouspdsdjjzfmlfafizjbkcae/Build/Intermediates.noindex/ArchiveIntermediates/MyApp/IntermediateBuildFilesPath/MyApp.build/Release-iphoneos/MyApp.build/Script-9002D8C42166BC850081D43D.sh: line 6: python: command not found
Command PhaseScriptExecution failed with a nonzero exit code

At a glance, it looks like xcode is attempting to run the script on the simulator instead of running in the local project directory.

python --version: Python 3.8.3

I am wondering if there is some new configuration that I am unaware of for new xcode versions?

EDIT:


Solution

  • So, Xcode seems to bundles its' own versions of python and python 3. It does not use the system version, so changes to Monteray 12.3 would not affect this.
    Since that is the case, the correct solution is changing python to python3 since it looks like an Xcode update dropped python2.7 to parallel the OS dropping it later. I had to also update my python file to ensure compatibility.