title: Can't profile iOS app: permission to debug was denied
body: <p>I am unable to profile my app using the simulator, I always get this error:</p>
  
  <pre><code>Target failed to run. Permission to debug [x] was denied.
  </code></pre>
  
  <p>Screenshot:</p>
  
  <p><a href="https://i.stack.imgur.com/kaIjj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kaIjj.png" alt="screenshot of Instruments with error"></a></p>
  
  <p>When I profile the app using an actual device, it works fine (iPhone running 11.1). Running the app on the simulator also works fine by the way. Please note that it's not mentioning provisioning profile or certificate problems, which is what similar questions on SO are about.</p>
  
  <p>The build configuration in the scheme for the Profile action is correctly set to Debug.</p>
  
  <p>I am using Xcode 9.1, but it was also a problem in 9.0.1. Can't remember about 9.0.0 but it definitely used to work in Xcode 8.</p>