| [ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
There are a variety of automated tests both stand-alone and instrumented for testing on emulators. These are in the ‘app/src/test’ and ‘app/src/androidTest’ directories respectively.
Running the stand-alone tests can be done from the command line:
./gradlew :app:testDebugUnitTest
For the instrumented tests, it’s recommended that you run these in
Android Studio where you can manage the virtual devices that the tests
run on. You must run certain tests separately from others; in
particular, NoteRepositoryTests has to run separately from all
of the tests in the notes.service and notes.ui packages
because the former requires the actual SQLite database on the device
while most of the rest of the tests use a mock repository, and only
one repository instance is allowed to be set up each time the
application is loaded. Android Studio starts the application fresh
each time you run a test from there, but running tests from the
gradlew CLI will re-use the same application process for all
tests which will cause conflicting tests to fail.
| 2.3.1 Using Virtual Devices | ||
| 2.3.2 Enabling USB Debugging | ||
| 2.3.3 Debugging the Application |
| [ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated on July 17, 2026 using texi2html 5.0.