mgamer mgamer - 29 days ago 15
Objective-C Question

Cannot build XCode project from command line but can from XCode

I've created in XCode a simple navigation-based iPhone app. The app builds and runs properly from under XCode but I cannot get it to build from command line.

From terminal I execute:

xcodebuild -project George.xcodeproj -alltargets -parallelizeTargets -configuration Debug build


but I get that error:

=== BUILD NATIVE TARGET George OF PROJECT George WITH CONFIGURATION Debug ===
Check dependencies
[BEROR]Code Sign error: The identity 'iPhone Developer' doesn't match any valid certificate/private key pair in the default keychain

** BUILD FAILED **


The following build commands failed:
Check dependencies
(1 failure)


Is there something wrong with the way I try to handle it?

Answer

In addition to unlocking the keychain, you might also specify the codesign identity (or set it in your target). Development certs take the form 'iPhone Developer: Company Inc', distribution certs like this 'iPhone Distribution: Company Inc'.

xcodebuild -project George.xcodeproj -alltargets -parallelizeTargets -configuration Debug build CODE_SIGN_IDENTITY='iPhone Developer: Company Inc' 
Comments