title: NoSuchSessionException: A session is either terminated or not started error occurs when app is in background for more than 10 minutes in Appium
body: <p>I have scenario to put the app in the background for more than 10 minutes but after ten minutes I am getting the following error</p>
  
  <pre><code>org.openqa.selenium.NoSuchSessionException: A session is either terminated or not started (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 0 milliseconds
  </code></pre>
  
  <p>If I run the app in background for 9 minutes it is working fine without any issues</p>
  
  <p><strong>driver.runAppInBackground(Duration.ofMinutes(10));</strong></p>
  
  <p>I have tried to fix this using <strong>capabilities.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT, 3600);</strong></p>
  
  <p>But it is also not working.</p>
  
  <p>Refer <a href="https://gist.github.com/alkaffkhanvrv/1e6d1bb58f33ac4b52ef2951536ad312" rel="nofollow noreferrer">appium log</a></p>