tags:

views:

269

answers:

2

Is this possible? How does Xcode actually deploy iPhone apps that were built into the iPhone?

Or is there another tool which I'm missing out on?

clarification: by "deploy" I mean actually install and run gdb on the iPhone like when you do run>debug

A: 

xcodebuild is what Xcode uses under the cover the build iPhone apps. So you can definitely use it to build the app. Just cd into the directory in which your project resides and then execute xcodebuild:

cd myProjectDir
xcodebuild

This will build the project in that directory, much in the same way as if you'd hit Build from xcode.

One thing you cannot do with xcodebuild is deploy the app to the iPhone. If you want to do this I beleive the simplest way is to use Xcode. If you want to automate this I would suggest using AppleScript.

You can find out more about xcodebuild here, a page which includes the following description of xcodebuild:

Run xcodebuild from the directory containing your project (i.e. the directory containing the projectname.xcodeproj package). If you have multiple projects in this directory you will need to use -project to indicate which project should be built.

By default, xcodebuild builds the first target listed in your project, with the default build configuration. The order of the targets is a property of the project and is the same for all users of the project. The active target and active build configuration properties are set for each user of the project and can vary from user to user.

pheelicks
Yeah, but can it actually install apps into the iPhone and run it with gdb on? Just like when you go "run>debug" on XCode.
kamziro
Not sure about that. I don't think that's what xcodebuild is for (as the name suggests). What is your motivation for doing this. If you're just trying to automate a menial task, I'd recommend using AppleScript to instruct Xcode to do what you require
pheelicks
I want to be able to build on my iphone through ssh (not just compile), but I guess applebuild can be given a try. Thanks for the suggestion!
kamziro
To use ssh you'd need a jailbroken iPhone
pheelicks
A: 

xcodebuild only builds targets, it does not run executables; there's no way for it to invoke the code that transfers an iPhone app to a device and starts the debugger.

cdespinosa