tags:

views:

849

answers:

3

In XCode, I can use CMD-R to run (or CMD-Y to debug), and my app will compile, install on the phone & start-up. (I've already prepped my phone & XCode so this part works as expected.)

What I'd LIKE to do is type CMD-<something else> and have my program compile & install on the phone, but NOT start-up.

I realize that I can just CMD-B to build, then go through some rigamarole to deploy, but I'm hoping one of you smart-folk can tell me the lazy-man's shortcut for all of this.

Thanks!

A: 

Have you looked into using Automator? Here's a good write up on how to automate XCode to build and what not.

sblundy
+3  A: 

Hey Olie, I haven't tried this because I don't have an iPhone to deploy to at the moment, but this /should/ work:

You can create a script which runs xcodebuild in your current project directory and give it the install target. Assuming you're going to want to debug at sometime, use the Debug configuration, otherwise use release. Then bind the script to some command key in the Xcode preferences and you should be on your way. To launch xcodebuild with debug you would do something like:

xcodebuild install -configuration Debug

If you have more than one target in your project you will have to specify that to xcodebuild as well:

xcodebuild install -target iPhoneApp -configuration Debug

You could also create a configuration specific to this scenario in your projects and pass that to xcodebuild and you should be able to script this in your favorite supported language (i.e., AppleScript, python, ruby, etc.).

HTH

Jason Coco
+1  A: 

I had the same question.

I ended up using the XCode Organizer. Select your current device. Summary Tab. "+" Applications..then select the one you just built (under /build/[debug|release]-iphoneos/.app

This does the install very easily.

m nelson