I ran into following error when clicking Build > Build and Go after you open your .xcodeproj file in XCode. I was attempting to download and run my iPhone app on my iPhone device (not the simulator).
Code Sign error: The identity ‘iPhone Developer’ doesn’t match any valid certificate/private key pair in the default keychain
The error means you need to create your provisioning profile (.mobileprovision file) and/or certificate (.cer file). To create both, first log into the iPhone Dev Center. Then click on the iPhone Developer Program Portal on the right:
Then click on “Launch Assistant” button (which will walk you through creating and installing the provisioning profile and certificate):