安装 ApexModuleTargetPreparer
public class InstallApexModuleTargetPreparer
extends SuiteApkInstaller
概括
受保护的方法 |
---|
void | addApksToTestFiles () |
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 实用程序。 |
void | installTrain ( TestInformation testInfo, moduleFilenames) installTrain ( TestInformation testInfo, moduleFilenames) 尝试在设备上安装包含顶点的主线序列。 |
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_OPTION 选项
protected static final String APEX_OPTION
APEX_SUFFIX
protected static final String APEX_SUFFIX
APK_SUFFIX
protected static final String APK_SUFFIX
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
mTrain文件夹路径
protected File mTrainFolderPath
公共构造函数
安装 ApexModuleTargetPreparer
public InstallApexModuleTargetPreparer ()
公共方法
public getModulesToInstall (TestInformation testInfo)
根据设备上预加载的模块获取应安装在火车上的模块。不会安装未预加载的模块。
setIgnoreIfNotPreloaded
public void setIgnoreIfNotPreloaded (boolean skip)
setSkipApexTearDown
public void setSkipApexTearDown (boolean skip)
public void tearDown (TestInformation testInfo,
Throwable e)
参数 |
---|
testInfo | TestInformation |
e | Throwable |
受保护的方法
添加 ApksToTestFiles
protected void addApksToTestFiles ()
检查顶点激活
protected void checkApexActivation (ITestDevice device)
检查是否所有顶点都已激活。
参数 |
---|
device | ITestDevice :正在测试中。 |
protected collectApexInfoFromApexModules ( testAppFileNames,
TestInformation testInfo)
从 apex 模块收集 apex 信息以进行激活检查。
getApkInstalled
protected getApkInstalled ()
protected String getBundletoolFileName ()
getModuleKeywordFromApexPackageName
protected String getModuleKeywordFromApexPackageName (String packageName)
从 apex 包名称中获取关键字(例如,com.android.tzdata.apex 的“tzdata”)。
参数 |
---|
packageName | String : apex 文件的包名。 |
退货 |
---|
String | 字符串 apex 包名称的关键字。 |
getModulesFailToActivate
protected getModulesFailToActivate ( activatedApexes)
获取激活失败的模块。
参数 |
---|
activatedApexes | :设备上的活动顶点集 |
protected getSplitsForApks (TestInformation testInfo,
File moduleFile)
提取并返回指定 apk 的拆分。
参数 |
---|
testInfo | TestInformation : TestInformation |
moduleFile | File :要从中提取拆分的模块文件。 |
protected void initBundletoolUtil (TestInformation testInfo)
为此类初始化 bundletool 实用程序。
protected void installTrain (TestInformation testInfo,
moduleFilenames)
尝试在设备上安装包含顶点的主线序列。
参数 |
---|
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 及其包。 |
检索顶点信息
protected ITestDevice.ApexInfo retrieveApexInfo (File testApexFile,
DeviceDescriptor deviceDescriptor)
从给定的 apex 文件中检索包含 packageName 和 versionCode 的 ApexInfo。
参数 |
---|
testApexFile | File :我们从中检索信息的顶点文件。 |
deviceDescriptor | DeviceDescriptor |