PDA

View Full Version : compile iphone app through terminal




rock6079
Nov 6, 2009, 02:34 PM
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!



jeremy.king
Nov 6, 2009, 03:05 PM
xcodebuild (http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPages/man1/xcodebuild.1.html)

bredell
Nov 6, 2009, 03:07 PM
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.

rock6079
Nov 6, 2009, 04:42 PM
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.

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!

robbieduncan
Nov 6, 2009, 04:44 PM
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!

I don't see how. The headers for the iPhone library's won't be there without the SDK.

skunkworker
Nov 6, 2009, 04:55 PM
Why don't you install it?

bredell
Nov 6, 2009, 06:33 PM
xcodebuild (http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPages/man1/xcodebuild.1.html)

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.

rock6079
Nov 6, 2009, 07:06 PM
Why don't you install it?

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.

prvnsgr
Nov 6, 2009, 08:01 PM
You should install SDK otherwise you can't compile iphone app

______________________________________________
forex software (http://it-org.blogspot.com/2009/11/forex-software.html)

skunkworker
Nov 6, 2009, 08:25 PM
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.

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.

firewood
Nov 7, 2009, 02:33 AM
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.

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?

dejo
Nov 7, 2009, 11:10 AM
Sounds like the perfect opportunity for ad-hoc distribution.