title: How do I fix "Missing Private Key" for xcode apple provisioning?
body: <p>On a new mac, I installed xcode and needed to set up provisioning for a hello-world project to deploy to my iPad.  </p>
  
  <p>NOTE: I am using the new FREE provisioning (do not have a paid Apple account)</p>
  
  <ol>
  <li>I went to <strong>Preferences/Account</strong> signed in to my Apple account</li>
  <li>In the project, <strong>General</strong> tab, <strong>Team</strong> is set to my (free) Apple Dev account. (all seemed well, it recognized this as valid)</li>
  <li>I tried to deploy to the iPad and I got a build error "<strong>codesign failed with exit code 1</strong>"</li>
  <li>Supposedly this is to do with certificates. I went to <strong>Keychain Access</strong> and found "<strong>iPhone Developer: my@email.com (...)</strong>" in there, which was added when I signed in via my Apple Account.</li>
  <li>I DELETED this key (thinking I would simply re-add my Apple Account and thus this key)</li>
  <li>I then removed and re-added my Apple account from xcode preferences</li>
  <li>I can sign-in, I can see it adds keys, and Keychain Access <strong>Get Info</strong> on the keys indicates no issues (valid, etc)</li>
  <li>In xcode Preferences, when I click <strong>Manage Certificates</strong>, it shows "David's MacBook Pro (2)" and a bunch of "Untitled" keys ALL of which have a status of "<strong>Missing Private Key</strong>".</li>
  <li>xcode/General/<strong>Status</strong> section says "<strong>The username or passphrase you entered is not correct</strong>" even though my "Team" is signed in and valid</li>
  <li>Clicking "<strong>Try Again</strong>" shows "Waiting to repair", followed by "revoking...", followed by "Generating certificates" - which sounds promising, like it's doing exactly what I need, but then fails, private keys still missing, and back to step 9 here in a loop of hell.</li>
  </ol>
  
  <p>ok?  How do I get this resolved without flattening my OS back to factory and starting completely over?</p>
  
  <p>Note: there are resolutions on SO that talk about Revoking the keys and generating new private keys from the Dev Console, like this one:
  <a href="https://stackoverflow.com/questions/16563364/how-can-i-add-private-key-to-the-distribution-certificate">How can I add private key to the distribution certificate?</a></p>
  
  <p>HOWEVER, on a "free" account I have NO access to the Certificates section! I can't manage anything from the Dev portal online.  I do, however, see xcode specifically set up to handle certs (see step 9-10 above) but it is not working.  I really don't know where to go from here.  I'm new to all things Mac and iOS and xcode.   Frustrated.  Thanks Apple, so much for a simple on-boarding experience on a simple hello-world app.  </p>