DeviceImageZipFlashingTargetPreparer

public class DeviceImageZipFlashingTargetPreparer
extends DeviceUpdateTargetPreparer

java.lang.Object
com.android.tradefed.targetprep.BaseTargetPreparer
  com.android.tradefed.targetprep.DeviceBuildInfoBootStrapper
    com.android.tradefed.targetprep.DeviceUpdateTargetPreparer
      com.android.tradefed.targetprep.DeviceImageZipFlashingTargetPreparer


一种目标准备器,用于使用特定格式提供的设备映像刷写设备。

设备映像格式的高级要求:

  • 设备映像文件必须是 zip 文件
  • zip 文件必须在根目录下包含 flash-all.sh 脚本
  • 该脚本必须假定设备处于用户空间中,且对 adb devices 可见
  • zip 文件的其余部分将解压缩到与脚本相同的位置,并采用相同的 目录布局,并且该脚本可以通过相对路径引用 zip 文件中打包的任何文件
  • 刷写后,该脚本必须将设备恢复到相同的状态
  • 环境变量 ANDROID_SERIAL 将设置为设备序列号,作为执行环境的一部分
  • 该脚本可以假定它在 PATH 上具有 adbfastboot
此目标准备器将解压缩设备映像 zip 文件,并在上述要求中概述的假设下执行随附的 flash- all.sh

摘要

公共构造函数

DeviceImageZipFlashingTargetPreparer()

受保护的方法

File getDeviceUpdateImage()

提供一个 File 实例,表示用于更新的设备映像文件

void performDeviceUpdate(File deviceUpdateImage, ITestDevice device)

展开设备映像更新 zip 文件并调用随附的刷写脚本

void postUpdateActions(File deviceUpdateImage, ITestDevice device)

空操作

void preUpdateActions(File deviceUpdateImage, ITestDevice device)

空操作

公共构造函数

DeviceImageZipFlashingTargetPreparer

public DeviceImageZipFlashingTargetPreparer ()

受保护的方法

getDeviceUpdateImage

protected File getDeviceUpdateImage ()

提供一个 File 实例,表示用于更新的设备映像文件

返回
File

performDeviceUpdate

protected void performDeviceUpdate (File deviceUpdateImage, 
                ITestDevice device)

展开设备映像更新 zip 文件并调用随附的刷写脚本

抛出
DeviceNotAvailableException
TargetSetupError

postUpdateActions

protected void postUpdateActions (File deviceUpdateImage, 
                ITestDevice device)

空操作

抛出
DeviceNotAvailableException
TargetSetupError

preUpdateActions

protected void preUpdateActions (File deviceUpdateImage, 
                ITestDevice device)

空操作

抛出
DeviceNotAvailableException
TargetSetupError