AVD Module
Manage Android Virtual Devices (AVDs).
android_device_manager.avd.AVDManager
High-level manager for Android Virtual Devices (AVDs).
Functions
__init__(sdk)
Initialize the AVDManager.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sdk
|
AndroidSDK
|
The Android SDK abstraction for resolving paths. |
required |
create(config, force=False)
Create a new AVD with the specified configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
AVDConfiguration
|
AVDConfiguration instance |
required |
force
|
bool
|
Overwrite existing AVD if True |
False
|
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if AVD was created successfully |
Raises:
| Type | Description |
|---|---|
AVDCreationError
|
If creation fails |
delete(name)
Delete an existing AVD by name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Name of the AVD to delete |
required |
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if AVD was deleted successfully |
Raises:
| Type | Description |
|---|---|
AVDDeletionError
|
If AVD deletion fails |
list()
List all available AVD names.
Returns:
| Type | Description |
|---|---|
List[str]
|
List[str]: Names of all available AVDs |
android_device_manager.avd.AVDConfiguration
dataclass
Configuration for an Android Virtual Device (AVD).
This dataclass encapsulates the minimal configuration needed to define an Android Virtual Device, such as its name and the associated system image package.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
The name of the AVD (must be unique within the Android SDK). |
package |
str
|
The system image package path (e.g. "system-images;android-34;google_apis;x86_64"). |
android_device_manager.avd.exceptions
Classes
AVDCreationError
Bases: AndroidDeviceManagerError
Raised when the creation of an Android Virtual Device (AVD) fails.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
The name of the AVD for which creation failed. |
message |
str
|
Details about the cause of the failure. |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the AVD. |
required |
message
|
str
|
Description of the creation error. |
required |
AVDDeletionError
Bases: AndroidDeviceManagerError
Raised when the deletion of an Android Virtual Device (AVD) fails.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
The name of the AVD for which deletion failed. |
message |
str
|
Details about the cause of the failure. |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the AVD. |
required |
message
|
str
|
Description of the deletion error. |
required |