No longer can load or test application on iPhone via XCode 11

Help Please ... My application development has completely stopped.


I mistakenly clicked "DENY" button when prompted to enter my password for loading my application on to my iPhone and now I can no longer load my application on "any" iPhones I have available for testing. Clicking the RUN button in XCode, "immediately" results in Build Failed and then clicking on the little RED error circle indicates the following:


"Command CodeSign failed with a nonzero exit code"


Typically, I would do the following to successfully load my application on my iPhone for testing:


  • Attach my iPhone via USB cable to my MacBook Air
  • Select my iPhone from the dropdown box (instead of a simulator)
  • Click RUN
  • Enter my Macbook Air password to allow the application to be loaded on to my iPhone
  • Application starts on my iPhone and can be used with XCode for debugging



I googled around for this error and see it has something to do with Mac KeyChain and certificates. I am "not" a Mac user at all so going in and messing with certificates makes me very nervous. I am afraid I will really mess something up and then not be able to develop my application anymore.


Since I clicked DENY, I am assuming this is blocking all iPhones from being loaded. How do I ALLOW again so XCode will start prompting me to enter my password again and allow my iPhones to be loaded and used for testing once again


Compiling and running using a specific Xcode simulator is still working, however, I need real iPhone to continue testing my app at this point


I tried "Product/Clean Build Folder" but this still did not allow me to load my real iPhone.



In "KeyChain Access" I do/see the following:


  • Select Login (Key Chains)
  • Select Keys (Category)
  • I see "Apple Development - <my Name> (private key)" listed
  • Clicking the little "expand arrow" icon I can see the following associated certificate:

Apple Development - <my Name> (Cert ##) (certificate)


After right-clicking the "(private key)" entry, selecting "Get Info" then "Access Control", I see the following option set:

Allow all appplications to access this item


After right-clicking the "(certificate)" entry, selecting "Get Info" and expanding the "Trust" section, I see the following option set:

When using this certificate = Use System Defaults

Answered by uncletr in 411492022

Thanks for the reply Claude !


After 3 hours of searching/reading I was able to find a Google posting which had the right answer for me:


I solved my issue with these steps:

  1. Open keychain access.
  2. Right-click the 'login' keychain and request to "Lock" it
  3. Right-click the 'login' keychain and request to "Unlock" it (enter your PC account password)
  4. In XCode, clean the project by selecting Product/Clean Build Folder option
  5. Select your attached iPhone in Xcode and Build the project
  6. Enter your PC account password everytime you are prompted (I was prompted 5 separate times)

I would first try:

- reboot the Mac

- reboot the device


If not enough, try to trust the device again:


https://support.apple.com/en-us/HT202778

Accepted Answer

Thanks for the reply Claude !


After 3 hours of searching/reading I was able to find a Google posting which had the right answer for me:


I solved my issue with these steps:

  1. Open keychain access.
  2. Right-click the 'login' keychain and request to "Lock" it
  3. Right-click the 'login' keychain and request to "Unlock" it (enter your PC account password)
  4. In XCode, clean the project by selecting Product/Clean Build Folder option
  5. Select your attached iPhone in Xcode and Build the project
  6. Enter your PC account password everytime you are prompted (I was prompted 5 separate times)

I just wonder if steps 4 to 6 would not have been enough…

Before I found the steps above that worked, I previously tried steps 4-6 only but when clicking RUN in XCode I would just get the error message. It never prompted me to enter a password.

Thanks for the feedback.

No longer can load or test application on iPhone via XCode 11
 
 
Q