Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
Is there any way run a unix command within an iPhone app built in xcode? I realize this won't be accepted into the app store, I am submitting it to Cydia. I have searched and searched and searched online, and even emailed people, but I can't find anything. Please help!!!

I would try including stdlib.h and see if the system() command works.
 
No, it didn't. I tried:

Code:
- (IBAction)installFlashlight {

    system(@"dpkg -i /MyMedia/flashlight_2.6.deb");

}
I also put "#include <stdlib.h>" (without quotes) at the beginning of the ViewController.h, right after "#import <UIKit/UIKit.h>". Am I doins something wrong? It didn't work, and a triple checked, and the file is there. Any suggestions?
 
Last edited:
Interesting this thread got moved here.

Did you try putting the full path to everything? dpkg won't be in your path when you run it from system() like this. It will be something like "/usr/bin/dpkg" or wherever cydia installs it.

Also, I somehow doubt if you would be allowed to do this, that system would take a NSString. It will probably take a "const char *"

I still really don't even know if this would work, and I am far too lazy to set up a new app and provisioning file to test it out.
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.