I'm trying to create executable file in swift to run main executable file with arguments i want to do it like this .sh file:
dir=$(dirname "$0")
exec "${dir}"/Main "$@"
how can i deploy such thing for iOS
I'm trying to create executable file in swift to run main executable file with arguments i want to do it like this .sh file:
dir=$(dirname "$0")
exec "${dir}"/Main "$@"
how can i deploy such thing for iOS
You can use NSTask
:
func shell(args: String...) -> Int32 {
let task = NSTask()
task.launchPath = "/usr/bin/env"
task.arguments = args
task.launch()
task.waitUntilExit()
return task.terminationStatus
}
let appPath = dir + "Main"
shell(appPath, "arg1", "arg2")