2

I'm trying to make an iOS app to run an executable file from code. The file is in /usr/bin/, and I need to execute it with arguments.

How can I do it?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Yuval.M
  • 145
  • 1
  • 5
  • This can only be done on jailbroken devices and it can't be done for apps meant for the App Store. – rmaddy Jun 15 '13 at 18:32
  • Thats fine, I have a jailbroken iPhone and I'm not going to publish it. so.. how can I do this – Yuval.M Jun 15 '13 at 18:36
  • 1
    See the code fragment in the accepted answer to this question: http://stackoverflow.com/questions/4326684 – CuriousRabbit Jun 15 '13 at 20:19
  • 1
    @CuriousRabbit, (or JustSid) you should submit that as an **answer**. That's a valid solution to this problem, but this question is not a duplicate of the other question because this is for iOS. – Nate Jun 16 '13 at 03:17

1 Answers1

1

I was able to call some command line applications using NSTask as described here:

NSTask or equivalent for iPhone

Including the NSTask.h header file from Mac OS X was enough to get this working on my jailbroken device.

Community
  • 1
  • 1
newenglander
  • 2,019
  • 24
  • 55