You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I am very new to iPhone programming, the first and most useful thing I may need to do with my phone is exactly to check server statues. So, I would really like to be able to send a command to a remote server and get the STDOUT,STDERR and exitcode.
In the example provided for 'Execute ssh command' I don't understand where the command for the server really is. Suppose I want to run a simple ls -la, it is not clear at all to me where to write ls -la. I tried to guess it without luck. Any help would be very much appreciated.
let command = Command(host: "localhost", port: 22)
// ...
command.connect()
.authenticate(.byPassword(username: "username", password: "password"))
.execute(command) { (command, result: String?, error) in
if let result = result {
print("\(result)")
} else {
print("ERROR: \(error)")
}
}
The text was updated successfully, but these errors were encountered:
@nmingotti Is this library used with Objective-C or Swift? Because after installing the Podfile, when I tried importing it in my Swift ViewController, I got the error "Could not build Objective-C Module 'SwiftSH'". Please let me know how to use this library?
Thanks in advance!
Hi, I am very new to iPhone programming, the first and most useful thing I may need to do with my phone is exactly to check server statues. So, I would really like to be able to send a command to a remote server and get the STDOUT,STDERR and exitcode.
In the example provided for 'Execute ssh command' I don't understand where the command for the server really is. Suppose I want to run a simple
ls -la
, it is not clear at all to me where to writels -la
. I tried to guess it without luck. Any help would be very much appreciated.The text was updated successfully, but these errors were encountered: