Stay organized with collections
Save and categorize content based on your preferences.
ManagedVirtualDevice
@Incubating interface ManagedVirtualDevice : Device
Device type for emulators to be managed by the Android Gradle Plugin.
When a device group containing this device is run for tests, Gradle will:
-
Automatically start up an emulator matching the device definition. Including downloading any and all required system image files and creating the avd.
-
Run the tests on this device.
-
Close the emulator upon completion.
These APIs are experimental and may change without notice.
Summary
Public properties |
String |
The application binary interface for the device image.
|
Int |
The api level of Android to be run on the device.
|
String |
The hardware profile of the device to be emulated.
|
Boolean |
Whether the image must be a 64 bit image.
|
String |
Which source the system image should come from.
|
Inherited functions |
From class Named
|
Public properties
abi
val abi: String
The application binary interface for the device image.
apiLevel
val apiLevel: Int
The api level of Android to be run on the device.
This will default to the target api level of the application.
device
val device: String
The hardware profile of the device to be emulated.
require64Bit
val require64Bit: Boolean
Whether the image must be a 64 bit image. Defaults to false.
On x86_64 machines: When false, the managed device will use the 32 bit image if available with the given api level and source, otherwise fallback to the 64 bit image. When true, the 64 image must be used and setup will fail if an appropriate image does not exist. On arm machines: The value of this parameter has no effect. An arm64 image is always selected.
systemImageSource
val systemImageSource: String
Which source the system image should come from. Either "google", "google-atd", "aosp", or "aosp-atd"
"google", the default, will select Google Play images for the device. "google-atd" will use automated test device images from Google Play. "aosp" will use aosp images for the device. "aosp-atd" will use automated test device image from aosp.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# ManagedVirtualDevice\n====================\n\n\n```\n@Incubating interface ManagedVirtualDevice : Device\n```\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nDevice type for emulators to be managed by the Android Gradle Plugin.\n\nWhen a device group containing this device is run for tests, Gradle will:\n\n1. Automatically start up an emulator matching the device definition. Including downloading any and all required system image files and creating the avd.\n\n2. Run the tests on this device.\n\n3. Close the emulator upon completion.\n\nThese APIs are experimental and may change without notice.\n\nSummary\n-------\n\n| ### Public properties ||\n|------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [abi](/reference/tools/gradle-api/7.2/com/android/build/api/dsl/ManagedVirtualDevice#abi()) The application binary interface for the device image. |\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [apiLevel](/reference/tools/gradle-api/7.2/com/android/build/api/dsl/ManagedVirtualDevice#apiLevel()) The api level of Android to be run on the device. |\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [device](/reference/tools/gradle-api/7.2/com/android/build/api/dsl/ManagedVirtualDevice#device()) The hardware profile of the device to be emulated. |\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [require64Bit](/reference/tools/gradle-api/7.2/com/android/build/api/dsl/ManagedVirtualDevice#require64Bit()) Whether the image must be a 64 bit image. |\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [systemImageSource](/reference/tools/gradle-api/7.2/com/android/build/api/dsl/ManagedVirtualDevice#systemImageSource()) Which source the system image should come from. |\n\n| ### Inherited functions ||\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| From class [Named](https://docs.gradle.org/current/javadoc/org/gradle/api/Named.html) |----------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------| | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [getName](https://docs.gradle.org/current/javadoc/org/gradle/api/Named.html#getName--)`()` | |\n\nPublic properties\n-----------------\n\n### abi\n\n```\nval abi: String\n```\n\nThe application binary interface for the device image. \n\n### apiLevel\n\n```\nval apiLevel: Int\n```\n\nThe api level of Android to be run on the device.\n\nThis will default to the target api level of the application. \n\n### device\n\n```\nval device: String\n```\n\nThe hardware profile of the device to be emulated. \n\n### require64Bit\n\n```\nval require64Bit: Boolean\n```\n\nWhether the image must be a 64 bit image. Defaults to false.\n\nOn x86_64 machines: When false, the managed device will use the 32 bit image if available with the given api level and source, otherwise fallback to the 64 bit image. When true, the 64 image must be used and setup will fail if an appropriate image does not exist. On arm machines: The value of this parameter has no effect. An arm64 image is always selected. \n\n### systemImageSource\n\n```\nval systemImageSource: String\n```\n\nWhich source the system image should come from. Either \"google\", \"google-atd\", \"aosp\", or \"aosp-atd\"\n\n\"google\", the default, will select Google Play images for the device. \"google-atd\" will use automated test device images from Google Play. \"aosp\" will use aosp images for the device. \"aosp-atd\" will use automated test device image from aosp."]]