views:

188

answers:

1

I can already build an app with a distribution profile via the command line

xcodebuild -configuration Distribution -sdk iphoneos3.0 clean build

However, I'd like to go one step further and install the app to the connected iPhone and execute it ( as if I'd pressed Build and Run in XCode ).

The final command listed in the build commands window ( cmd+shift+B ) is CodeSign, which as far as I know just signs the code and nothing else. So I'm not sure what command ( if any is available ) I can run from the command line to install and run the app on the iPhone.

I'm running the official SDK, not a jailbroken phone.

+1  A: 

If you have a post build script you should be able to install it and run it using a script. If you're jailbroken you should be able to use SCP and then execute it directly.

There may be an AppleScript or automator way of solving the problem as well.

Epsilon Prime
It's not clear to me what command would perform the installation.
dave
If your jailbroken and have OpenSSH installed you should be able to:scp -Crp $APPDIR/build/Release-iphoneos/Example.app root@$IPHONE_IP:/Applications/
Epsilon Prime
Personally I just ncftp the application to my FTP server so I (and my testers) can fetch it later:#!/bin/shcd "$HOME/src/bidding_practice/trunk/Personal Bridge Scorer/build/Release-iphoneos"zip -pr PBS.zip Personal\ Bridge\ Scorer.appecho "put PBS.zip" | ncftp mywebsiterm PBS.zip#!/bin/shrm -f PBS.zipwget http://mywebsite.com/PBS.zipunzip PBS.ziprm -f PBS.ziprm -rf /Applications/Personal\ Bridge\ Scorer.app/mv Personal\ Bridge\ Scorer.app/ /Applications/You could set up thed SSH to run the pull script automatically.
Epsilon Prime
On gitgub there's a project called iPhoneSim that allows you to control publishing and debugging in the simulator:http://github.com/jhaynie/iphonesim
Epsilon Prime