title: Espresso Instrumentation Tests - how to uninstall or delete the app after the test
body: <p>I setup Espresso instrumentation framework to run my Android Functional Automation tests. 
  For every test, I want to login to the app and delete the app after I finish the test. </p>
  
  <p>So, I setup something like below:</p>
  
  <p>public class FirstSampleTest extends BaseTest {</p>
  
  <pre><code>private final BaseTest baseTest;
  </code></pre>
  
  <p>//  private final ElementUtils elementUtils;</p>
  
  <pre><code>public FirstSampleTest() throws InterruptedException {
      this.baseTest = new BaseTest();
  }
  
  @Before
  public void initiate() throws InterruptedException {
      //I have setup login method here to login to the app after it installs
  }
  
  @Rule
  public ActivityTestRule&lt;SplashScreenActivity&gt; splashScreenActivityActivityTestRule = new ActivityTestRule(SplashScreenActivity.class);
  
  @Test
  public void testTheHomeScreen() throws InterruptedException {
     //Some tests go here. 
  }
  
  @After
  public void teardown() throws InterruptedException {
      //I want to uninstall the app or delete it from the emulator once the test is run 
  }
  
  }
  </code></pre>