嵌套类 |
---|
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 | |
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2021-10-04。
[{
"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":"其他"
}]