I have a run script in Xcode that I have written in Swift. In the build settings I have a run script whose shell is set to /bin/sh
and the contents is the single line ./my-script.swift
. That file contains only the lines:
#!/usr/bin/xcrun swift
import Foundation
If I build for the simulator, everything works just fine. If I build for the device I get a ton of errors along the lines of:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:11:10: Could not build module 'Darwin'
:0: Could not build Objective-C module 'CoreFoundation'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/usr/include/sys/cdefs.h:680:2: Unsupported architecture
Any ideas why this is?