Here is a simple swift script:
#!/usr/bin/env xcrun swift import Foundation let task = NSTask() task.launchPath = \"/bin/echo\" task.arguments = [\"farg1\", \"
If you unset the SDKROOT environment variable before calling the swift script, it will then use the OS X sdk.
SDKROOT