diff --git a/Sources/Foundation/Process.swift b/Sources/Foundation/Process.swift index 758dd1dfd4..92389a4995 100644 --- a/Sources/Foundation/Process.swift +++ b/Sources/Foundation/Process.swift @@ -1149,7 +1149,11 @@ open class Process: NSObject, @unchecked Sendable { // convenience; create and launch open class func launchedProcess(launchPath path: String, arguments: [String]) -> Process { let process = Process() - process.launchPath = path + if #available(macOS 10.13, *) { + process.executableURL = URL(fileURLWithPath:path) + } else { + process.launchPath = path + } process.arguments = arguments process.launch()