compile iphone app through terminal

Discussion in 'iOS Programming' started by rock6079, Nov 6, 2009.

  1. macrumors 6502

    Joined:
    Jan 6, 2004
    #1
    does anyone know if it is possible to compile iphone apps through the terminal, possibly using g++ or gcc or some other command? if so, how would one do this.

    basically I have my full application source code and want to compile it without having XCode installed or at least without launching and compiling through XCode. Is this possible?

    Thanks!
     
  2. macrumors 603

    jeremy.king

    Joined:
    Jul 23, 2002
    Location:
    Fuquay Varina, NC
  3. macrumors regular

    Joined:
    Mar 30, 2008
    Location:
    Uppsala, Sweden
    #3
    Sure, but you still need to have the iPhone SDK installed. Just create a Makefile, make sure that you point out the relevant frameworks you want to use and set the architecture with the "-arch" option. If you compile with "-arch i386" you get a binary that you should be able to run in the iPhone Simulator, and if you compile with "-arch armv6" you get a native binary. But I'm not sure how you would get that binary installed on a real iPhone device.

    When I create libraries from the command line I compile for both architectures and use the "lipo" command to create a fat binary, that way I get a library that works both in the simulator and on a real device.
     
  4. thread starter macrumors 6502

    Joined:
    Jan 6, 2004
    #4
    thx both of you.
    is there ANY possible way to do this without having iPhone SDK installed?

    a side note to bredell: uppsala, sweden: what an awesome and fun university city to go party in. man, i miss my days in sweden/denmark!
     
  5. Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #5
    I don't see how. The headers for the iPhone library's won't be there without the SDK.
     
  6. macrumors regular

    Joined:
    Sep 9, 2007
  7. macrumors regular

    Joined:
    Mar 30, 2008
    Location:
    Uppsala, Sweden
    #7
    Sweet! I hadn't seen that one. But it's just like Apple to provide command line tools for everything.

    You still need to have an Xcode project to use it, though.
     
  8. thread starter macrumors 6502

    Joined:
    Jan 6, 2004
    #8
    long story short, i am sending an un-compiled but ready to go app to a client who wants to compile it themselves :)confused:), but does not have XCode/iPhone SDK installed.

    So my plan was to build a quick application in RB or XCode that would allow them to click build and run the code through the terminal and produce the built app.

    Of course, the simple solution is to have them install XCode/iPhone SDK, but what I am asking for would be the ideal/less-confusing solution for the client, which I would prefer to provide.
     
  9. macrumors newbie

    Joined:
    Nov 6, 2009
    #9
    You should install SDK otherwise you can't compile iphone app

    ______________________________________________
    forex software
     
  10. macrumors regular

    Joined:
    Sep 9, 2007
    #10
    Installing Xcode/iPhone SDK puts all of the pieces in the right places, gcc4.2clang, and a ton of the frameworks, you need to install xcode/iphone sdk. If you are just testing out the application for viewing purposes look into sending just the iphone simulator build as it is not encrypted at all. And having them install it.
     
  11. macrumors 603

    Joined:
    Jul 29, 2003
    Location:
    Silicon Valley
    #11
    The compilers and libraries needed to build from the command line are only (easily) available in the iPhone SDK. The compiler that comes with the Mac doesn't compile for ARM. The libraries and frameworks that come with a stock Mac (or linux boxen) don't include UIKit.

    Maybe you want to look in some other forum for info on a jailbroke toolchain?
     
  12. Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #12
    Sounds like the perfect opportunity for ad-hoc distribution.
     

Share This Page