Cài đặtApexModuleTargetPreparer

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


Bản tóm tắt

Lĩnh vực

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

protected static final String SPLIT_APKS_SUFFIX

protected File mTrainFolderPath

Nhà thầu xây dựng công cộng

InstallApexModuleTargetPreparer ()

Phương pháp công khai

getModulesToInstall ( TestInformation testInfo)

Lấy các mô-đun cần được 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 pháp được bảo vệ

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

Kiểm tra xem tất cả các đỉnh đã được kích hoạt chưa.

collectApexInfoFromApexModules ( testAppFileNames, TestInformation testInfo) collectApexInfoFromApexModules ( testAppFileNames, TestInformation testInfo)

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

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

Lấy từ khóa (ví dụ: 'tzdata' cho com.android.tzdata.apex) từ tên gói apex.

getModulesFailToActivate ( activatedApexes) 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 tách cho các gói ứng dụng được chỉ định.

void initBundletoolUtil ( TestInformation testInfo)

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

void installTrain ( TestInformation testInfo, moduleFilenames) installTrain ( TestInformation testInfo, moduleFilenames)

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

void installUsingBundleTool ( TestInformation testInfo, testAppFileNames) installUsingBundleTool ( TestInformation testInfo, testAppFileNames)

Cố gắng cài đặt (các) mô-đun đường chính bằng cách sử dụng Bundletool.

void installer ( TestInformation testInfo, testAppFileNames) installer ( TestInformation testInfo, testAppFileNames)

Cố gắng cài đặt gói hoặc gói chia nhỏ 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.

Lĩnh vực

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

SPLIT_APKS_SUFFIX

protected static final String SPLIT_APKS_SUFFIX

mTrainFolderPath

protected File mTrainFolderPath

Nhà thầu xây dựng công cộng

Cài đặtApexModuleTargetPreparer

public InstallApexModuleTargetPreparer ()

Phương pháp công khai

getModulesToInstall

public  getModulesToInstall (TestInformation testInfo)

Lấy các mô-đun cần được 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 sẵn sẽ không được cài đặt.

Thông số
testInfo TestInformation : TestInformation

Trả lại
Danh sách trong số các mô-đun sẽ được cài đặt trên thiết bị.

Ném
DeviceNotAvailableException khi thiết bị không có sẵn.
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)

Thông số
skip boolean

setSkipApexTearDown

public void setSkipApexTearDown (boolean skip)

Thông số
skip boolean

cài đặt

public void setUp (TestInformation testInfo)

Thông số
testInfo TestInformation

Ném
BuildError
DeviceNotAvailableException
TargetSetupError

phá bỏ

public void tearDown (TestInformation testInfo, 
                Throwable e)

Thông số
testInfo TestInformation

e Throwable

Ném
DeviceNotAvailableException

Phương pháp được bảo vệ

addApksToTestFiles

protected void addApksToTestFiles ()

addStagedReadyTimeoutForAdb

protected void addStagedReadyTimeoutForAdb ( cmd)

Thông số
cmd

addTimeoutMillisForBundletool

protected void addTimeoutMillisForBundletool ( extraArgs)

Thông số
extraArgs

kiểm traApexKích hoạt

protected void checkApexActivation (ITestDevice device)

Kiểm tra xem tất cả các đỉnh đã được kích hoạt chưa.

Thông số
device ITestDevice : đang được thử nghiệm.

Ném
TargetSetupError nếu kích hoạt thất bại.
DeviceNotAvailableException

thu thậpApexInfoFromApexModules

protected  collectApexInfoFromApexModules ( testAppFileNames, 
                TestInformation testInfo)

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

Thông số
testAppFileNames : Danh sách tên file của các module cần cài đặt

testInfo TestInformation : TestInformation

Trả lại
một danh sách chứa thông tin apex của các mô-đun apex trong danh sách tệp đầu vào

Ném
TargetSetupError

getApkĐã cài đặt

protected  getApkInstalled ()

Trả lại

getBundletoolFileName

protected String getBundletoolFileName ()

Trả lại
String

getBundletoolUtil

protected BundletoolUtil getBundletoolUtil ()

Trả lại
BundletoolUtil

getModuleKeywordFromApexPackageName

protected String getModuleKeywordFromApexPackageName (String packageName)

Lấy từ khóa (ví dụ: 'tzdata' cho com.android.tzdata.apex) từ tên gói apex.

Thông số
packageName String : Tên gói của tệp apex.

Trả lại
String a string Từ khóa của tên gói apex.

getModulesFailToActivate

protected  getModulesFailToActivate ( activatedApexes)

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

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

Trả lại
một danh sách chứa thông tin đỉnh của các mô-đun đỉnh đầu vào không được kích hoạt.

Ném
DeviceNotAvailableException
TargetSetupError

getSplitsForApks

protected  getSplitsForApks (TestInformation testInfo, 
                File moduleFile)

Trích xuất và trả về các phần tách cho các gói ứng dụng được chỉ định.

Thông số
testInfo TestInformation : TestInformation

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

Trả lại
một Tệp [] chứa các phần tách.

Ném
TargetSetupError nếu không tìm thấy Bundletool hoặc tệp thông số thiết bị không tạo được.

initBundletoolUtil

protected void initBundletoolUtil (TestInformation testInfo)

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

Thông số
testInfo TestInformation : TestInformation cho lệnh gọi.

Ném
TargetSetupError nếu không tìm thấy Bundletool.

cài đặtTrain

protected void installTrain (TestInformation testInfo, 
                 moduleFilenames)

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

Thông số
testInfo TestInformation : TestInformation

moduleFilenames : Danh sách chuỗi. Danh sách tên tệp của các mô-đun đường chính sẽ được cài đặt.

Ném
DeviceNotAvailableException
TargetSetupError

cài đặtSử dụngBundleTool

protected void installUsingBundleTool (TestInformation testInfo, 
                 testAppFileNames)

Cố gắng cài đặt (các) mô-đun đường chính bằng cách sử dụng Bundletool.

Thông số
testInfo TestInformation : TestInformation

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

Ném
DeviceNotAvailableException
TargetSetupError

trình cài đặt

protected void installer (TestInformation testInfo, 
                 testAppFileNames)

Cố gắng cài đặt gói hoặc gói chia nhỏ trên thiết bị.

Thông số
testInfo TestInformation : TestInformation cho lệnh gọi

testAppFileNames : Các gói ứng dụng và gói của chúng sẽ được cài đặt.

Ném
DeviceNotAvailableException
TargetSetupError

truy xuấtApexInfo

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

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

Thông số
testApexFile File : Tệp đỉnh mà chúng tôi lấy thông tin từ đó.

deviceDescriptor DeviceDescriptor

Trả lại
ITestDevice.ApexInfo một ApexInfo chứa tên gói và mã phiên bản của tệp đã cho

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