iPhone app command?

Discussion in 'Jailbreaks and iOS Hacks' started by lynkynpark86, Jan 5, 2011.

  1. lynkynpark86 macrumors 6502

    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!!!
  2. ulbador macrumors 68000


    Feb 11, 2010
    I would try including stdlib.h and see if the system() command works.
  3. lynkynpark86 thread starter macrumors 6502

    would that work with dpkg?
  4. lynkynpark86, Jan 5, 2011
    Last edited: Jan 5, 2011

    lynkynpark86 thread starter macrumors 6502

    No, it didn't. I tried:

    - (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?
  5. lynkynpark86 thread starter macrumors 6502

    Wirelessly posted (Mozilla/5.0 (iPod; U; CPU iPhone OS 4_1 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8B117 Safari/6531.22.7)

  6. ulbador, Jan 6, 2011
    Last edited: Jan 6, 2011

    ulbador macrumors 68000


    Feb 11, 2010
    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.

Share This Page