title: How to simulate iPhone being put to sleep in iOS simulator?
body: <p>The iPhone app I'm working on seems to exhibit a bug when the phone is put to sleep in the middle of an operation.  Is there any way to simulate the phone being put to sleep in the iOS simulator?</p>
  
  <p>Specifically I'm referring to the user pressing the button on the top of the phone next to the headphones which immediately blanks the screen.</p>
  
  <p><strong>NOTE:</strong> The OP asked about "<strong>turning off</strong>" the phone, which is not what happens when you push the button on top.  Leaving here since part of getting to the solution is figuring out what question to ask.</p>