Swift Scripts Importing Cocoa Frameworks Broken on macOS 14
On macOS 14 Sonoma there is a regression in Swift 5.9 which causes Swift scripts that import Cocoa frameworks to fail.
[…]
The current workaround (also posted by @rdj) is to update the shebang,
#!/usr/bin/swift
, by replacing it with the following:#!/usr/bin/env DYLD_FRAMEWORK_PATH=/System/Library/Frameworks /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift
Previously: