KotlinMultiplatformAndroidDeviceTest

Added in 8.8.0-alpha08

interface KotlinMultiplatformAndroidDeviceTest


Summary

Public functions

Unit
Unit
Unit

Specifies options for the Android Debug Bridge (ADB), such as APK installation options.

Unit

Configures Gradle Managed Devices for use in testing with the Unified test platform.

Unit
Unit
signing(action: ApkSigningConfig.() -> Unit)

Public properties

Boolean

Disables animations during instrumented tests you run from the command line.

String?

The test application id.

EmulatorControl

Configures Android Emulator Grpc Access

EmulatorSnapshots

Configures Android Test Retention.

Boolean

Specifies code coverage is enabled for module tests of type AndroidTest.

String

Specifies whether to use on-device test orchestration.

Boolean?

See instrumentation.

Boolean?

See instrumentation.

Installation

Specifies options for the Android Debug Bridge (ADB), such as APK installation options.

String?

Test instrumentation runner class name.

MutableMap<StringString>

Test instrumentation runner custom arguments.

ManagedDevices

Configures Gradle Managed Devices for use in testing with the Unified test platform.

MultiDexConfig
ApkSigningConfig

Encapsulates signing configurations that you can apply to test APK

Public functions

emulatorControl

Added in 8.8.0-alpha08
@Incubating
fun emulatorControl(action: EmulatorControl.() -> Unit): Unit

emulatorSnapshots

Added in 8.8.0-alpha08
@Incubating
fun emulatorSnapshots(action: EmulatorSnapshots.() -> Unit): Unit

installation

Added in 8.8.0-alpha08
fun installation(action: Installation.() -> Unit): Unit

Specifies options for the Android Debug Bridge (ADB), such as APK installation options.

For more information about the properties you can configure in this block, see Installation.

managedDevices

Added in 8.8.0-alpha08
fun managedDevices(action: ManagedDevices.() -> Unit): Unit

Configures Gradle Managed Devices for use in testing with the Unified test platform.

multidex

Added in 8.8.0-alpha08
@Incubating
fun multidex(action: MultiDexConfig.() -> Unit): Unit

signing

Added in 8.8.0-alpha08
fun signing(action: ApkSigningConfig.() -> Unit): Unit

Public properties

animationsDisabled

Added in 8.8.0-alpha08
var animationsDisabledBoolean

Disables animations during instrumented tests you run from the command line.

If you set this property to true, running instrumented tests with Gradle from the command line executes am instrument with the --no-window-animation flag. By default, this property is set to false.

This property does not affect tests that you run using Android Studio. To learn more about running tests from the command line, see Test from the Command Line.

applicationId

Added in 8.8.0-alpha08
var applicationIdString?

The test application id.

emulatorControl

Added in 8.8.0-alpha08
val emulatorControlEmulatorControl

Configures Android Emulator Grpc Access

Android Emulator Grpc Access will make it possible to interact with the emulator over gRPC

emulatorControl {
enable true
secondsValid 180
allowedEndpoints.addAll(
"/android.emulation.control.EmulatorController/getStatus",
"/android.emulation.control.EmulatorController/getVmState")
}

emulatorSnapshots

Added in 8.8.0-alpha08
val emulatorSnapshotsEmulatorSnapshots

Configures Android Test Retention.

Android Test Retention automatically takes emulator snapshots on test failures. It can only work with Unified Test Platform (UTP).

emulatorSnapshots {
enableForTestFailures true
maxSnapshotsForTestFailures 2
compressSnapshots false
}

enableCoverage

Added in 8.8.0-alpha08
var enableCoverageBoolean

Specifies code coverage is enabled for module tests of type AndroidTest.

If enabled, prepares module class files for code coverage collection such as instrumenting dependent library classes and module classes. This allows for code coverage reports to be generated.

execution

Added in 8.8.0-alpha08
var executionString

Specifies whether to use on-device test orchestration.

If you want to use Android Test Orchestrator you need to specify "ANDROID_TEST_ORCHESTRATOR", as shown below. By default, this property is set to "HOST", which disables on-device orchestration.

functionalTest

Added in 8.8.0-alpha08
var functionalTestBoolean?

See instrumentation.

handleProfiling

Added in 8.8.0-alpha08
var handleProfilingBoolean?

See instrumentation.

installation

Added in 8.8.0-alpha08
val installationInstallation

Specifies options for the Android Debug Bridge (ADB), such as APK installation options.

For more information about the properties you can configure in this block, see Installation.

instrumentationRunner

Added in 8.8.0-alpha08
var instrumentationRunnerString?

Test instrumentation runner class name. This is a fully qualified class name of the runner See instrumentation.

instrumentationRunnerArguments

Added in 8.8.0-alpha08
val instrumentationRunnerArgumentsMutableMap<StringString>

Test instrumentation runner custom arguments.

e.g. [key: "value"] will give adb shell am instrument -w -e key value com.example...

See instrumentation.

Test runner arguments can also be specified from the command line:

./gradlew connectedAndroidTest -Pandroid.testInstrumentationRunnerArguments.size=medium
./gradlew connectedAndroidTest -Pandroid.testInstrumentationRunnerArguments.foo=bar

managedDevices

Added in 8.8.0-alpha08
val managedDevicesManagedDevices

Configures Gradle Managed Devices for use in testing with the Unified test platform.

multidex

Added in 8.8.0-alpha08
val multidexMultiDexConfig

signing

Added in 8.8.0-alpha08
val signingApkSigningConfig

Encapsulates signing configurations that you can apply to test APK

For more information about the properties you can configure in this block, see ApkSigningConfig.