InstallApexModuleTargetPreparer

public class InstallApexModuleTargetPreparer
extends SuiteApkInstaller

java.lang.Object
   ↳ com.android.tradefed.targetprep.BaseTargetPreparer
     ↳ com.android.tradefed.targetprep.TestAppInstallSetup
       ↳ com.android.tradefed.targetprep.suite.SuiteApkInstaller
         ↳ com.android.tradefed.targetprep.InstallApexModuleTargetPreparer


Tóm tắt

Trường

protected static final String APEX_OPTION

protected static final String APEX_SUFFIX

protected static final String APK_SUFFIX

protected static final String APK_ZIP_OPTION

protected static final String CHILD_SESSION_CREATION_CMD

protected static final String PARENT_SESSION_CREATION_CMD

public static final String ROLLBACK_STATE_COMMITTED

public static final String ROLLBACK_STATE_UNKNOWN

protected static final String SPLIT_APKS_SUFFIX

protected File mTrainFolderPath

Hàm khởi tạo công khai

InstallApexModuleTargetPreparer()

Phương thức công khai

getModulesToInstall(TestInformation testInfo)

Lấy các mô-đun cần cài đặt trên tàu, dựa trên các mô-đun được tải sẵn trên thiết bị.

void setIgnoreIfNotPreloaded(boolean skip)
void setSkipApexTearDown(boolean skip)
void setUp(TestInformation testInfo)

void tearDown(TestInformation testInfo, Throwable e)

Phương thức được bảo vệ

void addApksToTestFiles()
void addStagedReadyTimeoutForAdb( cmd)
void addTimeoutMillisForBundletool( extraArgs)
void checkApexActivation(ITestDevice device)

Kiểm tra xem tất cả đỉnh chóp có được kích hoạt hay không.

collectApexInfoFromApexModules( testAppFileNames, TestInformation testInfo)

Thu thập thông tin về đỉnh từ các mô-đun đỉnh để kiểm tra việc kích hoạt.

getApkInstalled()
String getBundletoolFileName()
BundletoolUtil getBundletoolUtil()
String getModuleKeywordFromApexPackageName(String packageName)

Lấy từ khoá (ví dụ: "tzdata" cho com.android.tzdata.apex) từ tên gói đỉnh.

getModulesFailToActivate( activatedApexes)

Nhận các mô-đun không kích hoạt được.

getSplitsForApks(TestInformation testInfo, File moduleFile)

Trích xuất và trả về các phần phân tách cho các tệp apk đã chỉ định.

void initBundletoolUtil(TestInformation testInfo)

Khởi chạy tiện ích bundletool cho lớp này.

void installTrain(TestInformation testInfo, moduleFilenames)

Cố gắng cài đặt một đoàn tàu chính chứa apex trên thiết bị.

void installUsingBundleTool(TestInformation testInfo, testAppFileNames)

Cố gắng cài đặt(các) mô-đun chính bằng bundletool.

void installer(TestInformation testInfo, testAppFileNames)

Cố gắng cài đặt một gói hoặc gói phân tách trên thiết bị.

ITestDevice.ApexInfo retrieveApexInfo(File testApexFile, DeviceDescriptor deviceDescriptor)

Truy xuất ApexInfo chứa packageName và versionCode từ tệp apex đã cho.

Trường

APEX_OPTION

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

ROLLBACK_STATE_COMMITTED

public static final String ROLLBACK_STATE_COMMITTED

ROLLBACK_STATE_UNKNOWN

public static final String ROLLBACK_STATE_UNKNOWN

SPLIT_APKS_SUFFIX

protected static final String SPLIT_APKS_SUFFIX

mTrainFolderPath

protected File mTrainFolderPath

Hàm khởi tạo công khai

InstallApexModuleTargetPreparer

public InstallApexModuleTargetPreparer ()

Phương thức công khai

getModulesToInstall

public  getModulesToInstall (TestInformation testInfo)

Lấy các mô-đun cần cài đặt trên tàu, dựa trên các mô-đun được tải sẵn trên thiết bị. Các mô-đun không được tải trước sẽ không được cài đặt.

Tham số
testInfo TestInformation: TestInformation

Giá trị trả về
Danh sách các mô-đun cần cài đặt trên thiết bị.

Gửi
DeviceNotAvailableException khi không có thiết bị.
TargetSetupError khi các mô-đun bắt buộc chưa được cài đặt hoặc không thể cài đặt mô-đun.

setIgnoreIfNotPreloaded

public void setIgnoreIfNotPreloaded (boolean skip)

Tham số
skip boolean

setSkipApexTearDown

public void setSkipApexTearDown (boolean skip)

Tham số
skip boolean

setUp

public void setUp (TestInformation testInfo)

Tham số
testInfo TestInformation

Gửi
BuildError
DeviceNotAvailableException
TargetSetupError

tearDown

public void tearDown (TestInformation testInfo, 
                Throwable e)

Tham số
testInfo TestInformation

e Throwable

Gửi
DeviceNotAvailableException
DeviceRuntimeException

Phương thức được bảo vệ

addApksToTestFiles

protected void addApksToTestFiles ()

addStagedReadyTimeoutForAdb

protected void addStagedReadyTimeoutForAdb ( cmd)

Tham số
cmd

addTimeoutMillisForBundletool

protected void addTimeoutMillisForBundletool ( extraArgs)

Tham số
extraArgs

checkApexActivation

protected void checkApexActivation (ITestDevice device)

Kiểm tra xem tất cả đỉnh chóp có được kích hoạt hay không.

Tham số
device ITestDevice: đang được kiểm thử.

Gửi
TargetSetupError nếu không kích hoạt được.
DeviceNotAvailableException

collectApexInfoFromApexModules

protected  collectApexInfoFromApexModules ( testAppFileNames, 
                TestInformation testInfo)

Thu thập thông tin về đỉnh từ các mô-đun đỉnh để kiểm tra việc kích hoạt.

Tham số
testAppFileNames : Danh sách tên tệp của các mô-đun cần cài đặt

testInfo TestInformation: TestInformation

Giá trị trả về
danh sách chứa apexinfo của các mô-đun apex trong danh sách tệp đầu vào

Gửi
TargetSetupError

getApkInstalled

protected  getApkInstalled ()

Giá trị trả về

getBundletoolFileName

protected String getBundletoolFileName ()

Giá trị trả về
String

getBundletoolUtil

protected BundletoolUtil getBundletoolUtil ()

Giá trị trả về
BundletoolUtil

getModuleKeywordFromApexPackageName

protected String getModuleKeywordFromApexPackageName (String packageName)

Lấy từ khoá (ví dụ: "tzdata" cho com.android.tzdata.apex) từ tên gói đỉnh.

Tham số
packageName String: Tên gói của tệp đỉnh.

Giá trị trả về
String một chuỗi Từ khoá của tên gói đỉnh.

getModulesFailToActivate

protected  getModulesFailToActivate ( activatedApexes)

Nhận các mô-đun không kích hoạt được.

Tham số
activatedApexes : Tập hợp các đỉnh hoạt động trên thiết bị

Giá trị trả về
danh sách chứa apexinfo của các mô-đun apex đầu vào không kích hoạt được.

Gửi
DeviceNotAvailableException
TargetSetupError

getSplitsForApks

protected  getSplitsForApks (TestInformation testInfo, 
                File moduleFile)

Trích xuất và trả về các phần phân tách cho các tệp apk đã chỉ định.

Tham số
testInfo TestInformation: TestInformation

moduleFile File: Tệp mô-đun để trích xuất các phần phân tách.

Giá trị trả về
một File[] chứa các phần phân tách.

Gửi
TargetSetupError nếu không tìm thấy bundletool hoặc không tạo được tệp thông số kỹ thuật của thiết bị.

initBundletoolUtil

protected void initBundletoolUtil (TestInformation testInfo)

Khởi chạy tiện ích bundletool cho lớp này.

Tham số
testInfo TestInformation: TestInformation cho lệnh gọi.

Gửi
TargetSetupError nếu không tìm thấy bundletool.

installTrain

protected void installTrain (TestInformation testInfo, 
                 moduleFilenames)

Cố gắng cài đặt một đoàn tàu chính chứa apex trên thiết bị.

Tham số
testInfo TestInformation: TestInformation

moduleFilenames : Danh sách Chuỗi. Danh sách tên tệp của các mô-đun chính cần cài đặt.

Gửi
DeviceNotAvailableException
TargetSetupError

installUsingBundleTool

protected void installUsingBundleTool (TestInformation testInfo, 
                 testAppFileNames)

Cố gắng cài đặt(các) mô-đun chính bằng bundletool.

Tham số
testInfo TestInformation: TestInformation

testAppFileNames : tên tệp của các mô-đun được tải trước để cài đặt.

Gửi
DeviceNotAvailableException
TargetSetupError

trình cài đặt

protected void installer (TestInformation testInfo, 
                 testAppFileNames)

Cố gắng cài đặt một gói hoặc gói phân tách trên thiết bị.

Tham số
testInfo TestInformation: TestInformation cho lệnh gọi

testAppFileNames : Tệp APK và gói của tệp APK cần cài đặt.

Gửi
DeviceNotAvailableException
TargetSetupError

retrieveApexInfo

protected ITestDevice.ApexInfo retrieveApexInfo (File testApexFile, 
                DeviceDescriptor deviceDescriptor)

Truy xuất ApexInfo chứa packageName và versionCode từ tệp apex đã cho.

Tham số
testApexFile File: Tệp đỉnh mà chúng ta truy xuất thông tin.

deviceDescriptor DeviceDescriptor

Giá trị trả về
ITestDevice.ApexInfo ApexInfo chứa packageName và versionCode của tệp đã cho

Gửi
TargetSetupError nếu trình phân tích cú pháp aapt không phân tích cú pháp được tệp.