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()

提供 ERROR(/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 ()

提供 ERROR(/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