Reputation: 11
I want to execute a Shell Command in my Swift Application. I read that i can't use NSTask, because there is no built in SSH in the iPhone. Now my question is how i can implement this without NSTask.
Upvotes: 1
Views: 2152
Reputation: 11
Instead of creating your own app you may want to look into an iOS app called 'Workflow'. It includes a module called 'Run Script Over SSH' which does exactly what the title states.
Upvotes: 1
Reputation: 13791
Any use of API that forks and spawns a new process is disallowed by the App Store rules, so if you want to do this for an app you plan to submit, the short answer is that you can't.
NSTask
and the exec*(3)
family of C library functions certainly exist on iOS, but they aren't public API.
If you need SSH functionality, you need to find a library that provides that functionality to pass App Store review.
Upvotes: 0