This module now uses com.android.test and targets :app directly. Gradle builds the tested app APK and the benchmark test APK together, installs both on the connected device, and runs the selected benchmark. You do not need to manually assemble and install the app APK first.
- Use a real Android device. Do not use an emulator for macrobenchmarks.
- Connect exactly one Android device.
- If running a login benchmark, make sure the benchmark account can still register a device.
- The current setup is aimed at the
prodflavor with thebenchmarkbuild type.
Run the startup benchmark without login:
./gradlew :benchmark:connectedProdBenchmarkBenchmarkAndroidTest \
-Pandroid.testInstrumentationRunnerArguments.class=com.wire.benchmark.StartupBenchmark#startUpWithoutBaselineProfiler \
-Pandroid.testInstrumentationRunnerArguments.TARGET_PACKAGE="com.wire"Run the fixture-backed startup benchmark with login:
./gradlew :benchmark:connectedProdBenchmarkBenchmarkAndroidTest \
-Pandroid.testInstrumentationRunnerArguments.class=com.wire.benchmark.StartupBenchmarkWithLogin#startUpWithoutBaselineProfiler \
-Pandroid.testInstrumentationRunnerArguments.TARGET_PACKAGE="com.wire" \
-Pandroid.testInstrumentationRunnerArguments.BACKEND_NAME="STAGING"Run the fixture-backed baseline profile generator:
./gradlew :benchmark:connectedProdBenchmarkBenchmarkAndroidTest \
-Pandroid.testInstrumentationRunnerArguments.class=com.wire.benchmark.BaselineGenerator \
-Pandroid.testInstrumentationRunnerArguments.TARGET_PACKAGE="com.wire" \
-Pandroid.testInstrumentationRunnerArguments.BACKEND_NAME="STAGING"Run the manual-credentials startup benchmark with login:
./gradlew :benchmark:connectedProdBenchmarkBenchmarkAndroidTest \
-Pandroid.testInstrumentationRunnerArguments.class=com.wire.benchmark.ManualStartupBenchmarkWithLogin#startUpWithoutBaselineProfiler \
-Pandroid.testInstrumentationRunnerArguments.TARGET_PACKAGE="com.wire" \
-Pandroid.testInstrumentationRunnerArguments.EMAIL="$EMAIL" \
-Pandroid.testInstrumentationRunnerArguments.PASSWORD="$PASSWORD"Run the manual-credentials baseline profile generator:
./gradlew :benchmark:connectedProdBenchmarkBenchmarkAndroidTest \
-Pandroid.testInstrumentationRunnerArguments.class=com.wire.benchmark.ManualBaselineGenerator \
-Pandroid.testInstrumentationRunnerArguments.TARGET_PACKAGE="com.wire" \
-Pandroid.testInstrumentationRunnerArguments.EMAIL="$EMAIL" \
-Pandroid.testInstrumentationRunnerArguments.PASSWORD="$PASSWORD" \
-Pandroid.testInstrumentationRunnerArguments.CONVERSATION_NAME="Some Conversation"- Fixture-backed classes use
TARGET_PACKAGE,BACKEND_NAME, and optionalCONVERSATION_NAME. - Manual classes use
TARGET_PACKAGE,EMAIL,PASSWORD, and optionalCONVERSATION_NAME. - The app APK is produced from
:appautomatically throughtargetProjectPath = ":app". - Benchmark output is written under
benchmark/build/outputs/connected_android_test_additional_output/. - The committed pre-profile reference snapshot lives under
benchmark/baselines/.