C command-line applications

Discussion in 'iOS Development' started by jt_69V, May 16, 2010.

  1. jt_69V

    jt_69V New Member

    Joined:
    May 16, 2010
    Messages:
    2
    Likes Received:
    0
    Hello

    I am looking for the simplest way to compile a plain C command-line application for a (jailbroken) iPhone. Is it possible with XCode ?

    I have a Mac with MacOS 10.6.3, XCode 3.2.2 and iPhone SDK 3.2, and an iPhone 3GS with iPhoneOS 3.1.2.

    Thank you
    J.
  2. lauNchD

    lauNchD Well-Known Member

    Joined:
    Jan 27, 2008
    Messages:
    1,844
    Likes Received:
    261
    Device:
    iPhone 5 (Black)
    The easiest (albeit somewhat annoying) way is to simply create the tool using the normal iPhone app template. The resulting executable can be used normally if you convince it it's not an app. Remove UIKit, Foundation etc. from your target (unless you want to use them) and take UIApplicationMain() out of main.m
    Additionally, you could modify Xcode build settings to get rid of the .app packaging.
  3. jt_69V

    jt_69V New Member

    Joined:
    May 16, 2010
    Messages:
    2
    Likes Received:
    0
    Thanks for the reply.
    Has anybody got experience with this way ?
    I must admit that I don't see how to do what you suggested

    Please Register or Log in to view images


    Or is there a less annoying way ?

Share This Page