Results 1 to 8 of 8

Your favorite Apple, iPhone, iPad, iOS, Jailbreak, and Cydia site.


Thread: Howto use command line iOS tools from Xcode?

  1. #1
    What's Jailbreak? cowzkull's Avatar
    Join Date
    May 2008
    Location
    Denmark
    Posts
    21
    Thanks
    3
    Thanked 1 Time in 1 Post
    Default Howto use command line iOS tools from Xcode?
    I would like to create an iOS frontend for some of the (jailbreak) command line tools - wget for instance - using Xcode.

    Can I run command line apps (or bash scripts) from within my app and grab the output?
    An Xcode code example would be appreciated

  2. #2
    Quote Originally Posted by cowzkull View Post
    I would like to create an iOS frontend for some of the (jailbreak) command line tools - wget for instance - using Xcode.

    Can I run command line apps (or bash scripts) from within my app and grab the output?
    An Xcode code example would be appreciated
    Hi all, hi cowzkull,

    im new to Obj-C and Xcode(c#/java dev),

    but anyway back to topic i am a few steps further and managed to run an "echo string" via NSTask/NMTaskWrapper, it works fine in the simulator but when i try to run it on my iPhone4 (5.1.1 JB)device the app crashes on the [task launch] command with an NSInconsistencyException.

    Do i have to somehow create a new Project with a CydiaAppTemplate, f.e. project template from Theos to get this running?

    Regards
    kaya

  3. #3
    What's Jailbreak? cowzkull's Avatar
    Join Date
    May 2008
    Location
    Denmark
    Posts
    21
    Thanks
    3
    Thanked 1 Time in 1 Post
    It might be that NSTask isn't native to the iPhone SDK... How did you manage to import it?

  4. #4


    well for NSTask, get the NMTaskWrapper, works well if your app is like in my video tutorial.

    well in my case, i need root rights for calling some commands...
    if someone knows how, please dont hesitate and post a reply :=)

  5. The Following User Says Thank You to Kayhan 17# For This Useful Post:

    cowzkull (08-19-2012)

  6. #5
    What's Jailbreak? cowzkull's Avatar
    Join Date
    May 2008
    Location
    Denmark
    Posts
    21
    Thanks
    3
    Thanked 1 Time in 1 Post
    Sorry for leaving you hanging - I was busy getting my own app ready for submission. There's still a lot of things to do but I worked out a few things - including how to run stuff as root (though the solution is far from perfect).
    You can set SUID for the app that needs to run as root - though it can potentially be a security disaster.
    In my case I chose to let whoever downloads my app do it manually since it shouldn't open up security holes just by installing.
    In my case: chmod u+s /usr/bin/nmap
    If it's a script in your app that needs root you can SUID it with the post install deb script.

    You can read more about my Nmap GUI over on my blog - hope it gets approved soon
    Nmap GUI – Nmap for iPhone, iPad and iPad Evilpigeon.dk

  7. #6
    What's Jailbreak? cowzkull's Avatar
    Join Date
    May 2008
    Location
    Denmark
    Posts
    21
    Thanks
    3
    Thanked 1 Time in 1 Post
    If you want to create a postinst script, just place it in your DEBIAN folder and chmod +x it.

    NMTaskWrapper does the job ok but it's kind of annoying that you have to wait for the reponse (textview.text = [NMTaskWrapper response] - do you think there's any way the response can be displayed on the fly?

  8. #7
    ive created a postinst script and set "chown root:wheel" and "chmod 755", my app still runs with the mobile user
    Last edited by Kayhan 17#; 08-29-2012 at 12:12 PM.

  9. #8
    finally got it working...

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •