Do you want to actually run the Terminal app? Or runs shell scripts like they would be run in the Terminal app? If it’s the latter, you can use the
Processclass, built in to Swift Foundation. If it’s the former, things get more complex. You can launch Terminal and tell it do things via its AppleScript interface. It’s possible to run such scripts programmatically from Swift, but it’s a bit tricky (the code is not too hard, but to write it you’ll need to understand a lot about how various parts of the OS fit together).
Share and Enjoy
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"