Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a quick way to build & install to iPhone (from Xcode) without starting the app?

Tags:

xcode

iphone

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.

like image 635
Olie Avatar asked Nov 07 '08 18:11

Olie


2 Answers

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

like image 170
Jason Coco Avatar answered Oct 29 '22 10:10

Jason Coco


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.

like image 45
m nelson Avatar answered Oct 29 '22 10:10

m nelson