You can pull any data generated during the tests using
This is useful if your test generates any extra data like screenshots, logs,
data snapshots, etc.
If you run your tests with coverage there’s no need to explicitly download the coverage files, use
--with-coverageinstead and emulator.wtf will grab code coverage data automatically. Read more here.
The folders will be pulled from the emulator once the test has finished and
written to the path indicated by
--outputs-dir. For example, if your app
captures screenshots to
/sdcard/Download/screenshots during the test you can
pull them using the combination of
--directories-to-pull /sdcard/Download/screenshots --outputs-dir /tmp/foo. In this case the screenshots will be downloaded to
/tmp/foo/sdcard/Download/screenshots after the test has finished.
Use comma-separated values to pull multiple locations, e.g. to pull both
/sdcard/test-logs you can write
To write to the
/sdcard/ folder your
androidTest manifest needs
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
If you’re also using the test orchestrator together with clear package data,
you’ll need to reacquire this permission before every test runs using a
@get:Rule val writeRule = GrantPermissionRule.grant(Manifest.permission.WRITE_EXTERNAL_STORAGE)
@Rule public GrantPermissionRule writeRule = GrantPermissionRule.grant(Manifest.permission.WRITE_EXTERNAL_STORAGE);