A journey is one user flow on the device, such as opening the settings screen and switching the theme. Run the same journeys for the debug capture and for both release replays, so that the debug log and the release log of a journey are comparable.
Go through the layers in order. For a crash, stop at the first layer that reproduces it. For narrowing, combine the layers until the journeys run the code that uses the classes of the rules you change.
journey. Search the project for files that contain <journey.src/androidTest of the app module.app/build/r8-assistant/journeys/.<journey name="settings"> <description> Open the settings screen and switch to the dark theme. </description> <actions> <action>Open the navigation drawer and tap "Settings"</action> <action>Tap "Theme" and select "Dark"</action> <action>Verify that the settings screen uses the dark theme</action> </actions> </journey>
Run a journey by performing its actions in order. Actions that start with “Verify” or “Check” are expectations: inspect the screen without interacting with it. The journey fails when an action is impossible, an expectation does not hold, or the app crashes, freezes or exits.
To inspect and drive the app, use the Android CLI, such as android layout and android screen capture, or use adb, such as adb shell uiautomator dump, adb shell input tap and adb shell input text.
Install the instrumented app first, as described in references/capture.md. Then build and install the test APK, find the test runner, and run the tests with am instrument:
./gradlew :app:assembleDebugAndroidTest adb install -r -t app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk adb shell pm list instrumentation adb shell am instrument -w com.example.app.test/androidx.test.runner.AndroidJUnitRunner
Do not run connectedAndroidTest: it replaces the instrumented APK and uninstalls the app.
am instrument runs all tests in one process, so one log covers the run. To get one log per test class, run each class on its own and pull the log after each run:
adb shell am instrument -w -e class com.example.app.SettingsTest com.example.app.test/androidx.test.runner.AndroidJUnitRunner
Tests that need Android Test Orchestrator or a fresh app process per test restart the app, and each restart truncates the log. Run those tests one at a time.
Use manual mode for logins, payments, hardware such as a camera, and flows that you are unable to reach. Tell the user which flow to perform, wait until they say that they are done, then pull the log. Write down the flow as a journey file, so that the release replays repeat it.
For each journey, record:
A rule whose classes no journey reached is uncovered. Leave it unchanged and list it in the report.
Write the journey files from your own exploration and from manual mode to app/build/r8-assistant/journeys/.
At the end of the run, offer to copy them into the project. Put them next to the journey files that the project already has. If it has none, ask the user for a directory.