title: Xcode Signing certificate is invalid when build on ext device
body: <p>I'm trying to solve an issue with Xcode 8.3.3 that prevents me to test my Apps on my devices.</p>
  
  <p>At the moment I'm using a free provisioning account for my tests.
  I've worked many months without any problem, then I've upgraded to Sierra and Xcode 8.3.3.
  Unfortunately I don't know exactly after what action/update the problem started, because I have not used Xcode for several months.</p>
  
  <p>The issue: when I try to build my app to run on my iPhone, I get these errors in project page, under General > Signing view:</p>
  
  <p><strong>Automatic signing failed</strong>
  Xcode failed to provision this target. Please file a bug report at <a href="http://bugreport.apple.com/" rel="nofollow noreferrer">http://bugreport.apple.com/</a> and include the Update Signing report from the Report navigator.</p>
  
  <p><strong>Signing certificate is invalid.</strong>
  Signing certificate "iPhone Developer: edoxxx@me.com (xxxxxxx)", serial number "xxxxxxx", is not valid for code signing. It may have been revoked or expired.</p>
  
  <p>The issue happens either on my main Mac account and also if I create a fresh new user account,
  it happens also if I use another AppleID account for code signing.
  but it doesn't happens if I boot the same machine into another macOS installation (using the same AppleID and same device). In this last case I'm able to build and run the app without any issue on my device.</p>
  
  <p>Because of that behaviour, I think that is something related to some software crap in the first OS installation, and not related to my user's "data" nor my AppleID account.</p>
  
  <p>I've tried everything I've found on internet to clean-up the Xcode installation, including total removal/reinstall plus Keychain cleanup. But nothing solved the problem.</p>
  
  <p>I've found some related informations in this topic:
  <a href="https://forums.developer.apple.com/thread/83611" rel="nofollow noreferrer">https://forums.developer.apple.com/thread/83611</a>‌
  but no real solution.</p>
  
  <p>Hope that someone could help me :)</p>
  
  <p>Bye,
  Edoardo</p>