High-level concept:
Xcode 5 has a validation and a distribution button on the Organizer window > Archives Tab. Occasionally when trying to access this area or sometimes when attempting to choose a signing identity or provisioning profile (under Preferences > Accounts) one will encounter an error. These errors are typically related to an invalid date associated with a certificate. The certificate might be associated with the provisioning profile or the signing identity.
To fix this type of error one should try the following:
- Login to the Developer Portal
- Access your Certificates depending on type of app being submitted
(iOS, Mac, Safari extension)
- Make sure that you have a valid distribution certificate (under
Production)
- Make sure your App-ID is configured (consider using a wildcard)
- Make sure your provisioning profile (distribution) is set and that it is
using a valid certificate
- Make sure the expiration dates are correct on each certificate you are using
- Download your certificate and provisioning profile to your desktop
(double-click to install)
- Make sure you select the correct profile (Build Settings > Search
Profile.. > Edit Provisioning Profile)
- Make sure your code signing identity is set to your automatic
distribution for your release code (Build Settings > Search Code
Signing Identity > Edit Release Setting to Automatic - [iOS]
Distribution)
What to do next:
Xcode should pick up the changes at this point so try your validation again (Organizer > Archives)... Assuming you are past validation you can distribute as needed. If any problems at this point open Spotlight > Search for Keychain > Evaluate the Certificates in your Keychain on your development environment to ensure that you have the correct certificates installed. If you have questions or issues beyond this, please consider reviewing the official app distribution guide. If this answer fits your use-case please consider accepting so that other users may find the proper solution.