Cannot run code on device

12,728

Solution 1

Check the Target properties, not just the Project, because it could be overridden there.

Solution 2

Similar thing just happened to me, in my case the "Target" settings were still set to the previous developer's certificate, while my "Project" settings were set to my new certificate. Xcode reported:

"Code Sign error: The identity 'iPhone Developer: ' doesn't match any valid certificate/private key pair in the login keychain"

Boot's answer worked for me - there are "Target" settings for signing that override the "Project" settings, which is why you may have needed to recreate the whole project, if you only changed the "Project" settings.

Solution 3

Change the Active SDK from iphone device to Iphone simulator. This will let you test your code on your iphone simulator. You need a cert if you plan on running your app on your device. (Maybe the code that you got was signed for device).

Share:
12,728
Vaerenberg
Author by

Vaerenberg

Developing and consulting for iOS and some Android since 2008. Worked on multiple top-selling and featured apps currently available on the App Store.

Updated on June 04, 2022

Comments

  • Vaerenberg
    Vaerenberg almost 2 years

    I have some source code which I had developed and later gave to another team. They signed it with their certificate and provisioning profile.

    Now I have the code back and have set the appropriate values in the project properties for code signing identity (with my cert and profile). But when I run the application on a device, I get an error showing the other team's certificate and prompting that the provisioning profile does not exist.

    I don't know where it is being referenced.

    Can someone please help.

    Thanks.

  • Vaerenberg
    Vaerenberg about 15 years
    That is what I did. Made sure all configurations have my provisioning profile. But the app won't even compile without showing the code sign error. Had to finally create a new project to be able to run the app.
  • Alex Reynolds
    Alex Reynolds about 15 years
    That's a puzzler. I always get caught with custom settings in the "Debug", "Release" and "Distribution" configurations. Picking "All Configurations" is a definite help to make sure all the configurations are using the same settings.
  • Vaerenberg
    Vaerenberg about 15 years
    Thanks Raj but the other team works on a different machine. So their profile is not installed on my mac (coz i've never installed it). My profile is already added in the Organizer and the phone. Code signing settings have already been changed. But still getting this error
  • Raj
    Raj about 15 years
    oh okay sorry, my mistake, i thought you were using the same iphone device for both machines!