安裝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 |