title: What's the fastest way to run unit tests in Android
body: <p>There are two options available to run unit tests in Android Studio:</p>
  
  <ol>
  <li>Right click on the file with your unit tests (which is <code>Gradle-Aware Make</code>).</li>
  <li><code>testAppDebugUnitTest</code> task is from the list of available Gradle tasks.</li>
  </ol>
  
  <p>The first one actually consists of two tasks:
  - <code>:app:assembleAppDebug</code> and <code>:app:assembleAppDebugUnitTest</code></p>
  
  <p>The second one is just <code>testAppDebugUnitTest</code> itself.</p>
  
  <p>The first one is a <a href="http://tools.android.com/tech-docs/unit-testing-support#TOC-Running-from-Gradle">recommended</a> way by Google Tools Team, but it takes as twice as much time compared to the second one. </p>
  
  <p>There is no visible difference how to run unit tests except the duration. You might think your code won't be compiled without <code>assembleAppDebug</code>, but this is not true - changes you introduce to either class under a test or a test itself compiled and executed as expected.</p>
  
  <p>So, what's the difference and why is it the recommended way if it takes as twice as much time to prepare everything before actual unit tests run?</p>