title: How to debug instrumentation tests in Android Studio?
body: <p>In Android Studio when I debug instrumentation test, the test won't stop on any breakpoint. Debugging unit tests works. I have a simple instrumented test that only checks if username edittext is displayed:</p>
  
  <pre><code>@RunWith(AndroidJUnit4.class)
  public class LogonActivityTest {
  
      @Rule
      public ActivityTestRule&lt;LogOnActivity&gt; mActivityRule = new ActivityTestRule&lt;&gt;(LogOnActivity.class, true, false);
  
      @Before
      public void setUp() throws Exception {
          mActivityRule.launchActivity(new Intent()); // breakpoint here
      }
  
      @Test
      public void testSimple() throws Exception {
          onView(withId(R.id.act_logon_et_username)).check(matches(isDisplayed())); // breakpoint here
      }
  }
  </code></pre>
  
  <p>In <code>build.gradle</code> I have properly set </p>
  
  <pre><code>testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
  </code></pre>
  
  <p>How can I debug instrumented tests? I'm using Espresso, Mockito and Dagger 2.</p>