Android Debug Bridge (adb)
This page outlines how the Launchable CLI interfaces with Android Debug Bridge (adb).
This is a reference page. See Getting started, Sending data to Launchable, and Subsetting your test runs for more comprehensive usage guidelines.

Recording test results

Currently, the CLI doesn't have a record tests command for ADB. Use the Gradle command instead.

Subsetting your test runs

The high level flow for subsetting is:
    1.
    Get the full list of tests/test paths and pass that to launchable subset with an optimization target for the subset
    2.
    launchable subset will get a subset from the Launchable platform and output that list to a text file
    3.
    Pass the text file into your test runner to run only those tests
To retrieve a subset of tests, first list all the tests you would normally run and pass that to launchable subset:
1
# '-e log true' option outputs test names without running
2
adb shell am instrument \
3
-w \
4
-r \
5
-e log true \
6
-e debug false \
7
com.yourdomain.test/androidx.test.runner.AndroidJUnitRunner \
8
> test_list.txt
9
cat test_list.txt | \
10
launchable subset \
11
--build <BUILD NAME> \
12
--confidence <TARGET> \
13
adb > launchable-subset.txt
Copied!
    The --build should use the same <BUILD NAME> value that you used before in launchable record build.
    The --confidence option should be a percentage; we suggest 90% to start. You can also use --time or --target; see Subsetting your test runs for more info.
This creates a file called launchable-subset.txt that you can pass into your command to run tests:
1
adb shell am instrument -w -e class $(cat launchable-subset.txt) com.yourdomain.test/androidx.test.runner.AndroidJUnitRunner
Copied!
Last modified 1mo ago