PDA

View Full Version : passing bash commands in xcode?




raziiq
Jul 24, 2009, 12:53 AM
Is there any way of passing bash script commands using xCode.

For example lets say i have a UIButton and when i tap that button, a bash shell Script runs.

Is it possible??



raziiq
Jul 26, 2009, 08:56 PM
i heard there is a command like

system("SSH command")

this is working fine in simulator but not working for me in the real iPhone.

Any suggestions?

firewood
Jul 26, 2009, 10:15 PM
It's possible.

But you would have to compile the entire bash shell into your app, as the iPhone OS doesn't allow any new processes to be launched or run. So bash would have to be part of your app (as would any other utilities you would want to run. If you wanted ssh, you would have to compile all of it as a subroutine in your app's process space).

The Simulator is inaccurate in that it doesn't enforce the security on an app's sandbox.

raziiq
Jul 26, 2009, 10:24 PM
It's possible.

But you would have to compile the entire bash shell into your app, as the iPhone OS doesn't allow any new processes to be launched or run. So bash would have to be part of your app (as would any other utilities you would want to run. If you wanted ssh, you would have to compile all of it as a subroutine in your app's process space).

The Simulator is inaccurate in that it doesn't enforce the security on an app's sandbox.

thanks for the reply. Can you please guide me how can i do this? What approach should i take to do this job efficiently?