Up to date (January 2021) (Xcode 10 – 12)
- Go to Xcode – Preferences – Accounts – Manage Certificates
- Click on the + at the bottom left, then Apple Distribution
- Wait a little, then click Done
That’s all.
You may want to revoke the old certificate on developer.apple.com too.
Old answer
Step 1: Xcode -> Product -> Archives ->
Click manage certificate
Step 2: Add iOS distribution