@Test
    public void useAppContext() throws Exception {
        // Context of the app under test.
        Context appContext = InstrumentationRegistry.getTargetContext();

        assertEquals("com.yl.uiautomatordemo", appContext.getPackageName());
    }
Instrumentation test, which will execute on an Android device.

@see <a href="http://d.android.com/tools/testing">Testing documentation</a>
UiAutomatorDemo/app/src/androidTest/java/com/yl/uiautomatordemo/ExampleInstrumentedTest.java