title: XCTests Failing on Physical Device: "Canceling tests due to timeout ..."
body: <p>XCTests are failing with the message: <code>*** Canceling tests due to timeout in Waiting for test process to check in...</code> This just started coming up in the last few days. I'm using Xcode 7.3.1, with iOS 9.3.2 running on an iPhone 6. My app is written mostly in Swift.</p>
  
  <p>I've seen some similar posts: </p>
  
  <ol>
  <li><a href="https://stackoverflow.com/questions/31381291/unable-to-run-xctests-on-ios-device">Unable to run XCTests on iOS device</a></li>
  <li><a href="https://stackoverflow.com/questions/29241877/ios-tests-will-not-run-on-simulator-when-using-jenkins-through-jnlp">iOS tests will not run on simulator when using Jenkins through JNLP</a></li>
  </ol>
  
  <p>Those other posts talk about this issue as arising with code signing. Code signing does not seem to be my problem-- I've looked at the KeyChain Access utility and don't see any relevant expired certificates. Also, what so far is (very temporarily) fixing my problem is to restart my iPhone. (Unfortunately, that fix doesn't last long-- maybe a few runs of XCtests and the problem is coming up again). I'm not running Jenkins, just XCTests.</p>
  
  <p>I have tried restarting Xcode and removing all files/folders from the DerivedData folder but neither of these resolves the problem.</p>
  
  <p>I <em>did</em> just install Xcode8 (first beta release). But aside from having launched it once or twice, I'm not generally using it. It does seem oddly coincidental that this issue is arising after having just installed that.</p>
  
  <p><em>Update 6/25/16</em>  </p>
  
  <p>I've narrowed this issue down somewhat. Several other symptoms appear at the same time as the timeout issue:  </p>
  
  <ol>
  <li>Console logging directly from <code>print</code> statements in the XCTest files stops.  </li>
  <li>Timer's fail-- this is actually the root of the problem. My tests involve first waiting for some server interaction, which occurs. But the wait uses an NSTimer which never executes its callback.  </li>
  <li>Breakpoints stop working.</li>
  </ol>
  
  <p>It seems worthwhile to note that I'm running these XCTest's manually. That is, I am running each test separately, so each test involves a build.</p>
  
  <p>Also, so far I have tested the following:</p>
  
  <ol>
  <li>Restarting Xcode (doesn't help)</li>
  <li>Restarting Mac OS X (doesn't help)</li>
  <li>Removing Derived Data contents (doesn't help)</li>
  <li>Restarting iPhone-- helps, but only again allows a few Xcode tests to run.</li>
  <li>Tried running with wifi versus hotspot on iPhone (no change to issue)</li>
  <li>TODO: Running with simulator</li>
  <li>Could this be a cable or USB port issue? Changing the cable connecting the device doesn't help.</li>
  <li>Deleting the app and reinstalling/rebuilding doesn't help.</li>
  <li>Tried on different hardware (iPad Air running iOS 9.3.2). Same issues.</li>
  </ol>
  
  <p>My configuration is: iOS 9.3.2, Xcode 7.3.1, Mac OS X 10.11.5 (15F34).</p>