title: Xcode 9.2 Simulator Debugging Broken; Could not attach to process id
body: <p>Xcode 9.2 debugging on an iOS Simulator has completely broken for me.</p>
  
  <p>I worked on this for hours and tried a ton of suggestions short of completely wiping my hard drive and starting out with a fresh operating system install. I ended up filing a bug with Apple. Posting here in case anyone has encountered this problem and has any suggestions.</p>
  
  <p><strong>Summary:</strong><br/>
  When try to build and run in debug mode with a debug executable. The simulator only opens the application to a white screen and then Xcode pops up an error:</p>
  
  <pre><code>Could not attach to pid: "&lt;a process id&gt;"
  Ensure "&lt;app&gt;" is not already running, and "&lt;user&gt;" has permission to debug it.
  </code></pre>
  
  <p><strong>Steps to Reproduce:</strong><br/>
  Make any project and try to run on any simulator.</p>
  
  <p><strong>Expected Results:</strong><br/>
  Debugger successfully attaches to debugger.</p>
  
  <p><strong>Actual Results:</strong><br/>
  Debugger is never able to attach to the iOS simulator process/app for debugging.
  Debugger CAN attach and build and run successfully on a physical device.</p>
  
  <p><strong>Version/Build:</strong><br/>
  - Xcode Version 9.2 (9C40b)<br/>
  - macOS Sierra 10.12.6<br/>
  - Any iOS project<br/>
  - Any iOS simulator<br/></p>
  
  <p><strong>Other notes:</strong><br/>
  - Xcode 9.2 was working fine until this problem randomly started. The error initially said:</p>
  
  <pre><code> Failed to initiate service connection to simulator
   DTServiceHubClient failed to bless service hub for 
   simulator iPhone 8 Plus &lt;simulator identifier&gt;
  </code></pre>
  
  <p>- After rebooting computer, the error shifted to "Could not attached to pid..."</p>
  
  <p><strong>I tried dozens of suggested solutions short of completely wiping my computer including:</strong> <br/></p>
  
  <ul>
  <li>Resetting device contents and settings on simulators</li>
  <li>Create a new device (even different device and OS combinations)</li>
  <li>Try different Xcode projects, even simple one-off single view applications</li>
  <li>Looking at the etc/hosts file and verifying localhost can be pinged</li>
  <li>Restarting computer multiple times</li>
  <li>Deleting out derived data (multiple times)</li>
  <li>Let it build and run without attaching debugger, then try to attach debugger by "attach to process id"</li>
  <li>Completely uninstalling Xcode and all simulators, and reinstalling.</li>
  <li>Removing any invalid certificates in keychain</li>
  </ul>
  
  <p><a href="https://i.stack.imgur.com/GHCr2.png" rel="noreferrer"><img src="https://i.stack.imgur.com/GHCr2.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/U8nW7.png" rel="noreferrer"><img src="https://i.stack.imgur.com/U8nW7.png" alt="enter image description here"></a></p>