title: Appium (Android): Time out on start-up after running 1 test on device
body: <p>TL;DR: I can run only 1 test against a certain device, then every other attempt to connect my app to an ADB session, manually or via an Appium server call, fails. How do I resolve this so that I can resume automated testing?</p>
  
  <p>The Appium desired_capabilities for my device includes <code>noReset = True</code>. All other desired_capabilities except device identifiers are shared among and work for all my other devices.<br>
  This error was not observed until I added <code>driver.reset()</code> to one of my tests. Removing that line of code has not resolved this issue. Because of this, I suspect that Appium is not the root cause of this error, but rather highlighted it. My desired capabilities are:  </p>
  
  <pre><code>`
  'platformName': 'Android',
  'platformVersion': '8.0',
  'deviceName': 'WVGA_API_26',
  'avd': 'WVGA_API_26',
  'app_package': 'com.ferly.ferly',
  'app_activity': 'host.exp.exponent.experience.ShellAppActivity',
  'app_wait_package': 'com.ferly.ferly',
  'automationName': 'UiAutomator2',
  'noReset': 'true',`
  </code></pre>
  
  <p>Attempting to initialize any driver session that uses the affected device gives the following error in Appium:  </p>
  
  <blockquote>
    <p>WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: Cannot start the 'com.ferly.ferly' application. Visit <a href="https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md" rel="nofollow noreferrer">https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md</a> for troubleshooting. Original error: Error executing adbExec. Original error: 'Command 'C:\Users\Jeff\AppData\Local\Android\sdk\platform-tools\adb.exe -P 5037 -s emulator-5558 shell am start -W -n com.ferly.ferly/host.exp.exponent.experience.ShellAppActivity -S' timed out after 20000ms'. Try to increase the 20000ms adb execution timeout represented by 'adbExecTimeout' capability</p>
  </blockquote>
  
  <p>Running the command in my Windows shell: <code>C:\Users\&lt;user&gt;\AppData\Local\Android\sdk\platform-tools\adb.exe -P 5037 -s emulator-5556 shell am start -W -n com.ferly.ferly/host.exp.exponent.experience.ShellAppActivity -S</code>, where emulator-5556 is the affected device, gives the following output:</p>
  
  <blockquote>
    <p>Stopping: com.ferly.ferly<br>
     Starting: Intent { cmp=com.ferly.ferly/host.exp.exponent.experience.ShellAppActivity }<br>
    ^C (manual break after 2 minutes of waiting.)  </p>
  </blockquote>
  
  <p>On my emulator, the app opens and can be used as I expect, but the adb session does not recognize that the app is opened.</p>
  
  <p>Running the same command, but for an unaffected device, say emulator-5558, succeeds with this output:</p>
  
  <blockquote>
    <p>Stopping: com.ferly.ferly<br>
    Starting: Intent { cmp=com.ferly.ferly/host.exp.exponent.experience.ShellAppActivity }<br>
    Warning: Activity not started, its current task has been brought to the front<br>
    Status: ok<br>
    ThisTime: 0<br>
    TotalTime: 0<br>
    WaitTime: 872<br>
    Complete  </p>
  </blockquote>
  
  <p>Workarounds: Uninstalling the Appium Settings app on the affected device after every test allows one test to be run on that device.</p>
  
  <p>What is the core issue I'm facing and how do I solve it? If it matters, my test scripts are all written in Python.  </p>