Open AvdLee opened 1 year ago
Something like this could work:
let startDate = Date()
Log.simctl.debug("Started running \(command)")
if let lastArgument = process.arguments?.last, lastArgument.count >= 1048576 {
process.arguments?.removeLast()
process.arguments?.append(String(lastArgument.prefix(10)))
let inputPipe = Pipe()
process.standardInput = inputPipe
inputPipe.fileHandleForWriting.write(lastArgument.prefix(1000).data(using: .utf8)!)
inputPipe.fileHandleForWriting.closeFile()
// process.launch()
// process.waitUntilExit()
try process.run()
} else {
try process.run()
}
Describe the bug
Reported by A. Bell
Tried my best to solve this, but it's pretty hard as we have to pipe in the arguments. However,
simctl
is not waiting for input and fails right away.Next step would be to find out how to execute commands in the terminal step by step.