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.