This drove me crazy - going around in circles, revoking certificates, downloading random certificates etc etc.
It turns out it was, as another poster has said, my system date and time wasn't set as automatic when it should be, so when I was revoking and installing new certificates, the times didn't match exactly and the certificates weren't showing as valid in Xcode.
I deleted the current development certificate in my keychain, reset my time and date to be automatically set from the apple server. restarted my machine, checked the time was correct, opened Xcode, revoked the current certificate to force a new one to download, then it all seemed to work.
the reason my time wasn't set to automatic was there's a bug in date and time which causes the location to be incorrect (I am in London but it comes up as Berlin as my location, so I had manually set my time.)
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: