嵌套類 class
ModuleOemTargetPreparer.ModuleInfo
一個簡單的結構類來存儲有關模塊的信息
受保護的方法 void
checkPreloadModules (TestInformation testInfo, DeviceDescriptor deviceDescriptor)
檢查預加載模塊信息
String[]
getApkDirectory (ITestDevice device, String packageName)
獲取系統目錄下的apk文件路徑
String
getPackageVersioncode (ITestDevice device, String packageName, boolean isAPK)
在給定包名稱的推送模塊後檢查包版本。
ModuleOemTargetPreparer.ModuleInfo
pushFile (File moduleFile, TestInformation testInfo)
將文件推送到 /system/apex/ for apex 或 /system/** for apk
String
renameFile (ITestDevice device, File moduleFile, String packageName)
將/system 下的待更新文件名重命名為相同的文件名。
void
setupDevice (TestInformation testInfo)
adb root 並在 /system 下推送文件之前重新掛載設備
公共構造函數 模塊OemTargetPreparer
public ModuleOemTargetPreparer ()
公共方法 checkModuleAfterPush
public void checkModuleAfterPush (ITestDevice device,
pushedModules) 推送後檢查模塊名稱和版本代碼
參數 device
ITestDevice
pushedModules
: 推送的模塊列表
投擲 TargetSetupError
如果沒有推送模塊,則拋出異常 DeviceNotAvailableException
如果沒有可用的設備,則拋出異常
public void setUp (TestInformation testInfo) 執行目標設置以進行測試,推送模塊以替換預加載的模塊
投擲 TargetSetupError
如果設置環境發生致命錯誤 BuildError
如果由於正在準備構建而發生錯誤 DeviceNotAvailableException
如果設備無響應
受保護的方法
protected void checkPreloadModules (TestInformation testInfo,
DeviceDescriptor deviceDescriptor) 檢查預加載模塊信息
參數 testInfo
TestInformation
:測試信息 deviceDescriptor
DeviceDescriptor
投擲 DeviceNotAvailableException
如果設備不可用則拋出異常 TargetSetupError
如果沒有預加載模塊,則拋出異常
獲取應用程序目錄
protected String[] getApkDirectory (ITestDevice device,
String packageName) 獲取系統目錄下的apk文件路徑
參數 device
ITestDevice
packageName
String
:模塊封裝名
退貨 String[]
帶有 apk 名稱和路徑的字符串數組
投擲 DeviceNotAvailableException
如果設備不可用 TargetSetupError
如果找不到包的路徑
獲取包版本代碼
protected String getPackageVersioncode (ITestDevice device,
String packageName,
boolean isAPK) 在給定包名稱的推送模塊後檢查包版本。
參數 packageName
String
:推包名 isAPK
boolean
投擲 DeviceNotAvailableException
如果未找到設備,則拋出異常。
protected ModuleOemTargetPreparer.ModuleInfo pushFile (File moduleFile,
TestInformation testInfo) 將文件推送到 /system/apex/ for apex 或 /system/** for apk
投擲 TargetSetupError
如果無法通過 adb 推送文件 DeviceNotAvailableException
如果設備不可用
重新命名文件
protected String renameFile (ITestDevice device,
File moduleFile,
String packageName) 將/system 下的待更新文件名重命名為相同的文件名。
參數 device
ITestDevice
:測試設備 moduleFile
File
:模塊文件被安裝 packageName
String
:名下/系統/ *
投擲 TargetSetupError
如果文件不能重命名 DeviceNotAvailableException
protected void setupDevice (TestInformation testInfo) adb root 並在 /system 下推送文件之前重新掛載設備
投擲 TargetSetupError
如果設備無法重新安裝。 DeviceNotAvailableException
提供意見
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 2021-10-04 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"缺少我需要的資訊"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"過於複雜/步驟過多"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"過時"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"翻譯問題"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"示例/程式碼問題"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"其他"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"容易理解"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"確實解決了我的問題"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"其他"
}]
想進一步說明嗎?