views:

322

answers:

2

When using Cruise Control to build an iPhone XCode project with Unit Tests, an error of "Code Sign error: a valid provisioning profile matching the application's Identifier 'com.yourcompany.Calculator' could not be found" is generated. This isn't encountered when run through XCode? Is Cruise Control trying to launch the app rather than just build it? Any suggestions?

+1  A: 

I don't know for sure if xcodebuild properly runs the code signing tool, but it sounds to me that you'll need to change your build process to use that tool (codesign).

I'm not sure if it's a pre-build or post-build task.

codesign man page: http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPages/man1/codesign.1.html

According to this this SO post, you may be able to get around this by telling xcodebuild to assume the target is the iPhone Simulator instead of the actual iPhone (with the -target command line option)

ravuya
A: 

The problem was caused by the addition of the Unit Test Bundle to the project. To ensure that tests were built and run along with the main project, I had dragged the Unit Tests target into the main project Target. By default, it had assigned the Unit Test Bundle to be built against the iPhone Device 3.1.2 SDK rather than the simulator. Also, the Unit Test Bundle had an auto-generated .plist file which contained the default Bundle Identifier of com.yourcompany...etc. So despite specifying a target which I knew had a default SDK of the iPhone Simulator 3.1.2, the inclusion of the Unit Test Bundle caused the error to keep appearing. Selecting 'Get Info' for the Unit Test bundle, select the Build tab and set the Base SDK to iPhone Simulator 3.1.2 and all will be well.

jbjon