Using Swift Scripts with Xcode | Kodeco, the new

Learn how to run Swift scripts as part of the Xcode build phase, giving you control to configure or validate your app while building your project.

This is a companion discussion topic for the original entry at

Hi. Thanks for the great article. I have a question. I saw the Process() inside of shell function. I tried using this function in my project but it says “Cannot find ‘Process’ in scope”. I tried finding in the HelloXcode project, but can’t find it in there. What do I have to do?

Hello @jamesryu108,
the function shell is intended to be used under macOS only, you can’t use it in an iOS project because there is no shell :smiley:
This file is compiled against the macOS sdk with the commands:

xcrun --sdk macosx swiftc -parse-as-library $SCRIPT_INPUT_FILE_0 Scripts/Shell.swift Scripts/OverlayLabel.swift Scripts/ImageOverlay.swift -o CompiledScript