Dunno if it's related but I seem to remember pbxbuild failing when using zsh instead of tcsh, which was the default shell on 10.1.x if I recall. I doubt Apple ever did anything to fix the problem and I *assume* xcodebuild has a related origin.
xcodebuild really does work. I use it in makefiles. FWIW, I'm using bash as the shell (i.e. the default setting).
Here's some old shell script for Project Builder that I used for an app I used to work on (ViaVoice was also built the same kind of way):
--- cut here --- #!/bin/tcsh
set productname = "Only Mortal.app"
set cleanresult = "-not run-" set buildresult = "-not run-"
if ( ("$1" == "all") || ("$1" == "clean") ) then pbxbuild clean set cleanresult = "$?" rm -rf ./build endif
if ( ("$1" == "all") || ("$1" == "build") ) then pbxbuild -buildstyle "Deployment" install set buildresult = "$?" endif
if ("$cleanresult" == "0") set cleanresult = "OK" if ("$buildresult" == "0") set buildresult = "OK" printf "##### %-55s Clean: %-15s Build: %-15s #####\n" "$productname" "$cleanresult" "$buildresult" --- cut here ---
Here's a more modern version using a makefile (this is how I make release builds):
--- cut here --- BUILD_TOOL=xcodebuild
debug: make -C ../Frameworks debug $(BUILD_TOOL) -target MyKillerApp -configuration "Development" echo make completed
release: make -C ../Frameworks release $(BUILD_TOOL) -target MyKillerApp -configuration "Deployment" strip ./build/MyKillerApp.app/Contents/MacOS/MyKillerApp echo make completed
clean: make -C ../Frameworks clean $(BUILD_TOOL) clean rm -rf ./build --- cut here ---
Your configuration names might be different as mine're from upgraded XCode 1.5 projects. Note I don't have Debug and Release directories in my the build directory. XCode 2.1 caused me a lot of hassle when Apple changed the default behavior until I figured out how to make it behave like XCode 2.0 and below.
Date: Thu, 8 Dec 2005 13:18:41 -0500 From: "Sean McBride" <email@hidden> Subject: xcodebuild "assertion failed" errors, can't build working project To: <email@hidden> Message-ID: <email@hidden">email@hidden> Content-Type: text/plain; charset=ISO-8859-1
Hi all,
I have an xcode 2.2 project that opens and builds fine with Xcode.app, but if i try 'xcodebuild' in Terminal it always fails, even invoking a simple 'xcodebuild clean'.
Is there anything I can do to get this working? Here is the gory details:
Thanks,
|