tags:

views:

142

answers:

2

I'm trying to setup application tests to run on my development device but following the steps outlined in Apple's "Development Guide: Unit Testing Applications" (listed here) doesn't seem to be enough. (

After I set the Base SDK to iPhone Device 3.0 and active target to MyAppTesting (Steps 9 & 10 under Application Testing), trying to Build & Run elicited the following error message about provisioning:

Code Sign error: a valid provisioning profile matching the application's Identifier 'com.yourcompany.MyAppTests' could not be found

I've verified that the Identifier (by highlighting the target, show Info -> Properties page) is the same for my regular target as well as my testing version.

What else needs to be followed in order to build and run the test version of the target on the development device? The settings I have do allow me run the application on the allowed development device as well as any of the provisioned distribution devices.

A: 

You need a Provisioning Profile whose application id matches your application's id. The Provisioning profile is obtained through your developer account with Apple.

Once the Provisioning Profile is installed on your device can then Code Sign your builds. You need to do this for both the main target and the test target. Basically it's trying to say "you've compiled this code, but you can't deploy the tests on your phone because you haven't signed them".

Malaxeur
I (think) have a profile setup and it's set to the same value under Build/Code Signing Identity for both the targets. Also, since I duplicated the testing version of the Target, wouldn't all of the values remain the same for the new Target?
Alexi Groove
A: 

It turns out that a plist file for each target is created and the bundle identifier in this file needs to match the application id. Problem solved!

Alexi Groove