Run swift script from Xcode iOS project as build phase

前端 未结 3 513
梦谈多话
梦谈多话 2021-02-01 05:20

Here is a simple swift script:

#!/usr/bin/env xcrun swift

import Foundation

let task = NSTask()
task.launchPath = \"/bin/echo\"
task.arguments = [\"farg1\", \"         


        
3条回答
  •  天涯浪人
    2021-02-01 05:33

    If you unset the SDKROOT environment variable before calling the swift script, it will then use the OS X sdk.

提交回复
热议问题