Certificate has either expired or has been revoked Certificate has either expired or has been revoked xcode xcode

Certificate has either expired or has been revoked


Edit: This answer doesn't work for Xcode 10 and higher. See turkenh's answer.


Solution

First of all, clean the project by holding Shift(⇧)+Command(⌘)+K orSelect Product > Clean

Then:

  1. Go to Xcode Menu> Preferences

  2. Select Accounts > Team > View Details

  3. Select any Provisioning profile from the Provisioning Profiles list

  4. Right-click > Select Show in Finder. Then you will see all lists of provisioning profiles

  5. Select all provisioning lists from the folder and move them to the trash

  6. Download All provisioning profiles by clicking Download All below Provisioning Profile lists.

Now, run again and it should work!


Edit: This answer doesn't work for Xcode 10 and higher. See turkenh's answer.


I had experienced this problem and was able to find an answer.

The answer which this is coming from can be found here.

Here is what you have to do:

  1. Go to Preferences->Accounts
  2. Press on your account
  3. Click "View Details"
  4. Click "Download All" in the lower left hand corner.

These steps solved the problem for me.


For those who cannot find "view details" button at Account > Team > View Details, here is how I solved this on Xcode 10:

  1. Delete all provisioning profiles at ~/Library/MobileDevice/Provisioning\ Profiles/
  2. Clean the project by holding Shift(⇧)+Command(⌘)+K or selecting Product > Clean (it might be labelled "Clean Build Folder")
  3. Restart Xcode

and try again.