安装ApexModuleTargetPreparer
public class InstallApexModuleTargetPreparer
extends SuiteApkInstaller
概括
受保护的方法 |
---|
void | addApksToTestFiles () |
void | addStagedReadyTimeoutForAdb ( cmd) addStagedReadyTimeoutForAdb ( cmd) |
void | addTimeoutMillisForBundletool ( extraArgs) addTimeoutMillisForBundletool ( extraArgs) |
void | checkApexActivation ( ITestDevice device) 检查是否所有顶点均已激活。 |
| collectApexInfoFromApexModules ( testAppFileNames, TestInformation testInfo) collectApexInfoFromApexModules ( testAppFileNames, TestInformation testInfo) 从 apex 模块收集 apex 信息以进行激活检查。 |
| getApkInstalled () |
String | getBundletoolFileName () |
BundletoolUtil | getBundletoolUtil () |
String | getModuleKeywordFromApexPackageName (String packageName) 从 apex 包名称获取关键字(例如,com.android.tzdata.apex 的“tzdata”)。 |
| getModulesFailToActivate ( activatedApexes) getModulesFailToActivate ( activatedApexes) 获取激活失败的模块。 |
| getSplitsForApks ( TestInformation testInfo, File moduleFile) 提取并返回指定 apk 的拆分。 |
void | initBundletoolUtil ( TestInformation testInfo) 初始化此类的bundletool util。 |
void | installTrain ( TestInformation testInfo, moduleFilenames) installTrain ( TestInformation testInfo, moduleFilenames) 尝试在设备上安装包含 apex 的主线列车。 |
void | installUsingBundleTool ( TestInformation testInfo, testAppFileNames) installUsingBundleTool ( TestInformation testInfo, testAppFileNames) 尝试使用bundletool安装主线模块。 |
void | installer ( TestInformation testInfo, testAppFileNames) installer ( TestInformation testInfo, testAppFileNames) 尝试在设备上安装软件包或拆分软件包。 |
ITestDevice.ApexInfo | retrieveApexInfo (File testApexFile, DeviceDescriptor deviceDescriptor) 从给定的 apex 文件中检索包含 packageName 和 versionCode 的 ApexInfo。 |
领域
APEX_选项
protected static final String APEX_OPTION
APEX_SUFFIX
protected static final String APEX_SUFFIX
APK_SUFFIX
protected static final String APK_SUFFIX
APK_ZIP_OPTION
protected static final String APK_ZIP_OPTION
CHILD_SESSION_CREATION_CMD
protected static final String CHILD_SESSION_CREATION_CMD
PARENT_SESSION_CREATION_CMD
protected static final String PARENT_SESSION_CREATION_CMD
SPLIT_APKS_SUFFIX
protected static final String SPLIT_APKS_SUFFIX
mTrainFolderPath
protected File mTrainFolderPath
公共构造函数
安装ApexModuleTargetPreparer
public InstallApexModuleTargetPreparer ()
公共方法
public getModulesToInstall (TestInformation testInfo)
根据设备上预加载的模块,获取应安装在列车上的模块。未预加载的模块将不会被安装。
设置忽略如果未预加载
public void setIgnoreIfNotPreloaded (boolean skip)
设置SkipApexTearDown
public void setSkipApexTearDown (boolean skip)
public void tearDown (TestInformation testInfo,
Throwable e)
参数 |
---|
testInfo | TestInformation |
e | Throwable |
受保护的方法
添加 Apks 到测试文件
protected void addApksToTestFiles ()
addStgedReadyTimeoutForAdb
protected void addStagedReadyTimeoutForAdb ( cmd)
protected void addTimeoutMillisForBundletool ( extraArgs)
检查Apex激活
protected void checkApexActivation (ITestDevice device)
检查是否所有顶点均已激活。
参数 |
---|
device | ITestDevice :正在测试中。 |
protected collectApexInfoFromApexModules ( testAppFileNames,
TestInformation testInfo)
从 apex 模块收集 apex 信息以进行激活检查。
退货 |
---|
| 包含输入文件列表中 apex 模块的 apexinfo 的列表 |
获取已安装的Apk
protected getApkInstalled ()
protected String getBundletoolFileName ()
从 ApexPackageName 获取模块关键字
protected String getModuleKeywordFromApexPackageName (String packageName)
从 apex 包名称获取关键字(例如,com.android.tzdata.apex 的“tzdata”)。
参数 |
---|
packageName | String : apex 文件的包名。 |
退货 |
---|
String | 字符串 apex 包名称的关键字。 |
获取模块激活失败
protected getModulesFailToActivate ( activatedApexes)
获取激活失败的模块。
参数 |
---|
activatedApexes | :设备上活动顶点的集合 |
退货 |
---|
| 包含激活失败的输入 apex 模块的 apexinfo 的列表。 |
protected getSplitsForApks (TestInformation testInfo,
File moduleFile)
提取并返回指定 apk 的拆分。
protected void initBundletoolUtil (TestInformation testInfo)
初始化此类的bundletool util。
protected void installTrain (TestInformation testInfo,
moduleFilenames)
尝试在设备上安装包含 apex 的主线列车。
参数 |
---|
testInfo | TestInformation : TestInformation |
moduleFilenames | :字符串列表。要安装的主线模块的文件名列表。 |
protected void installUsingBundleTool (TestInformation testInfo,
testAppFileNames)
尝试使用bundletool安装主线模块。
参数 |
---|
testInfo | TestInformation : TestInformation |
testAppFileNames | :要安装的预加载模块的文件名。 |
protected void installer (TestInformation testInfo,
testAppFileNames)
尝试在设备上安装软件包或拆分软件包。
参数 |
---|
testInfo | TestInformation :调用的TestInformation |
testAppFileNames | :要安装的apk及其包。 |
检索Apex信息
protected ITestDevice.ApexInfo retrieveApexInfo (File testApexFile,
DeviceDescriptor deviceDescriptor)
从给定的 apex 文件中检索包含 packageName 和 versionCode 的 ApexInfo。
参数 |
---|
testApexFile | File :我们从中检索信息的 apex 文件。 |
deviceDescriptor | DeviceDescriptor |