Starting March 27, 2025, we recommend using android-latest-release
instead of aosp-main
to build and contribute to AOSP. For more information, see Changes to AOSP.
Stay organized with collections
Save and categorize content based on your preferences.
DeviceImageZipFlashingTargetPreparer
public
class
DeviceImageZipFlashingTargetPreparer
extends DeviceUpdateTargetPreparer
A target preparer that flashes the device with device images provided via a specific format.
High level requirements for the device image format:
- Device image file must be a zip file
- The zip file must include a flash-all.sh script at the root
- The script must assume that the device is in userspace visible to
adb devices
- The rest of the zip file will be extracted into the same location as script with the same
directory layout, and the script may make reference to any files packaged in the zip via
relative path
- After flashing, the script must return the device to the same state
- An environment variable
ANDROID_SERIAL
will be set to device serial number as
part of the execution environment
- The script may assume that it has
adb
and fastboot
on PATH
This target preparer will unpack the device image zip file and execute the enclosed
flash-
all.sh
under the assumptions outline in requirements above.
Summary
Protected methods |
File
|
getDeviceUpdateImage()
Provides a ERROR(/File) instance representing the device image file to be used for updating
|
void
|
performDeviceUpdate(File deviceUpdateImage, ITestDevice device)
Expands the device image update zip and calls the enclosed flashing script
|
void
|
postUpdateActions(File deviceUpdateImage, ITestDevice device)
No-op
|
void
|
preUpdateActions(File deviceUpdateImage, ITestDevice device)
No-op
|
Public constructors
DeviceImageZipFlashingTargetPreparer
public DeviceImageZipFlashingTargetPreparer ()
Protected methods
getDeviceUpdateImage
protected File getDeviceUpdateImage ()
Provides a ERROR(/File)
instance representing the device image file to be used for updating
protected void performDeviceUpdate (File deviceUpdateImage,
ITestDevice device)
Expands the device image update zip and calls the enclosed flashing script
Throws |
DeviceNotAvailableException |
|
TargetSetupError |
|
postUpdateActions
protected void postUpdateActions (File deviceUpdateImage,
ITestDevice device)
No-op
Throws |
DeviceNotAvailableException |
|
TargetSetupError |
|
preUpdateActions
protected void preUpdateActions (File deviceUpdateImage,
ITestDevice device)
No-op
Throws |
DeviceNotAvailableException |
|
TargetSetupError |
|
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 2022-08-03 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 2022-08-03 UTC."],[],[],null,["# DeviceImageZipFlashingTargetPreparer\n====================================\n\n\n`\npublic\n\n\nclass\nDeviceImageZipFlashingTargetPreparer\n`\n\n\n`\n\n\n`\n\n`\n\n\n`\n\n`\n\n\n`\n\n`\n\nextends `[DeviceUpdateTargetPreparer](../../../../../../reference/tradefed/com/android/tradefed/targetprep/DeviceUpdateTargetPreparer.html)`\n\n\n`\n\n`\n\n\n`\n\n|---|---|---|---|----------------------------------------------------------------------|\n| java.lang.Object |||||\n| ↳ | [com.android.tradefed.targetprep.BaseTargetPreparer](../../../../../../reference/tradefed/com/android/tradefed/targetprep/BaseTargetPreparer.html) ||||\n| | ↳ | [com.android.tradefed.targetprep.DeviceBuildInfoBootStrapper](../../../../../../reference/tradefed/com/android/tradefed/targetprep/DeviceBuildInfoBootStrapper.html) |||\n| | | ↳ | [com.android.tradefed.targetprep.DeviceUpdateTargetPreparer](../../../../../../reference/tradefed/com/android/tradefed/targetprep/DeviceUpdateTargetPreparer.html) ||\n| | | | ↳ | com.android.tradefed.targetprep.DeviceImageZipFlashingTargetPreparer |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nA target preparer that flashes the device with device images provided via a specific format.\n\nHigh level requirements for the device image format:\n\n- Device image file must be a zip file\n- The zip file must include a flash-all.sh script at the root\n- The script must assume that the device is in userspace visible to `adb devices`\n- The rest of the zip file will be extracted into the same location as script with the same directory layout, and the script may make reference to any files packaged in the zip via relative path\n- After flashing, the script must return the device to the same state\n- An environment variable `ANDROID_SERIAL` will be set to device serial number as part of the execution environment\n- The script may assume that it has `adb` and `fastboot` on PATH\n\nThis target preparer will unpack the device image zip file and execute the enclosed `flash-\nall.sh` under the assumptions outline in requirements above.\n\n\u003cbr /\u003e\n\nSummary\n-------\n\n| ### Public constructors ||\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| ` `[DeviceImageZipFlashingTargetPreparer](../../../../../../reference/tradefed/com/android/tradefed/targetprep/DeviceImageZipFlashingTargetPreparer.html#DeviceImageZipFlashingTargetPreparer())`() ` |\n\n| ### Protected methods ||\n|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` File` | ` `[getDeviceUpdateImage](../../../../../../reference/tradefed/com/android/tradefed/targetprep/DeviceImageZipFlashingTargetPreparer.html#getDeviceUpdateImage())`() ` Provides a [ERROR(/File)](../../../../../../) instance representing the device image file to be used for updating |\n| ` void` | ` `[performDeviceUpdate](../../../../../../reference/tradefed/com/android/tradefed/targetprep/DeviceImageZipFlashingTargetPreparer.html#performDeviceUpdate(File,%20com.android.tradefed.device.ITestDevice))`(File deviceUpdateImage, ITestDevice device) ` Expands the device image update zip and calls the enclosed flashing script |\n| ` void` | ` `[postUpdateActions](../../../../../../reference/tradefed/com/android/tradefed/targetprep/DeviceImageZipFlashingTargetPreparer.html#postUpdateActions(File,%20com.android.tradefed.device.ITestDevice))`(File deviceUpdateImage, ITestDevice device) ` No-op |\n| ` void` | ` `[preUpdateActions](../../../../../../reference/tradefed/com/android/tradefed/targetprep/DeviceImageZipFlashingTargetPreparer.html#preUpdateActions(File,%20com.android.tradefed.device.ITestDevice))`(File deviceUpdateImage, ITestDevice device) ` No-op |\n\nPublic constructors\n-------------------\n\n### DeviceImageZipFlashingTargetPreparer\n\n```\npublic DeviceImageZipFlashingTargetPreparer ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nProtected methods\n-----------------\n\n### getDeviceUpdateImage\n\n```\nprotected File getDeviceUpdateImage ()\n```\n\nProvides a [ERROR(/File)](../../../../../../) instance representing the device image file to be used for updating\n\n\u003cbr /\u003e\n\n| Returns ||\n|--------|--------|\n| `File` | \u003cbr /\u003e |\n\n### performDeviceUpdate\n\n```\nprotected void performDeviceUpdate (File deviceUpdateImage, \n ITestDevice device)\n```\n\nExpands the device image update zip and calls the enclosed flashing script\n\n\u003cbr /\u003e\n\n| Throws ||\n|-------------------------------|---|\n| `DeviceNotAvailableException` | |\n| `TargetSetupError` | |\n\n### postUpdateActions\n\n```\nprotected void postUpdateActions (File deviceUpdateImage, \n ITestDevice device)\n```\n\nNo-op\n\n\u003cbr /\u003e\n\n| Throws ||\n|-------------------------------|---|\n| `DeviceNotAvailableException` | |\n| `TargetSetupError` | |\n\n### preUpdateActions\n\n```\nprotected void preUpdateActions (File deviceUpdateImage, \n ITestDevice device)\n```\n\nNo-op\n\n\u003cbr /\u003e\n\n| Throws ||\n|-------------------------------|---|\n| `DeviceNotAvailableException` | |\n| `TargetSetupError` | |"]]