Cài đặtApexModuleTarget Chuẩn bị

public class InstallApexModuleTargetPreparer
extends SuiteApkInstaller

java.lang.Object
   ↳ com.android.tradefed.targetprep.BaseTargetOutcomer
     ↳ com.android.tradefed.targetprep.TestAppInstallSetup
       ↳ com.android.tradefed.targetprep.suite.SuiteApkInstaller
         ↳ com.android.tradefed.targetprep.InstallApexModuleTargetSupportedr


Tóm tắt

Trường

protected static final String APEX_SUFFIX

protected static final String APK_SUFFIX

protected static final String SPLIT_APKS_SUFFIX

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 phải được cài đặt trên tàu, dựa trên các mô-đun đã tải trước 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()
collectApexInfoFromApexModules( testAppFileNames, TestInformation testInfo)

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

boolean containsPersistentApk( testAppFileNames, TestInformation testInfo)

Kiểm tra xem tệp đầu vào có chứa bất kỳ APK cố định nào không.

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

Xem từ khoá (ví dụ: "tzdata" cho com.android.tzdata.apex) từ tên gói apex.

getModulesFailToActivate( activatedApexes)

Tải 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 được chỉ định.

void initBundletoolUtil(TestInformation testInfo)

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

void installTrain(TestInformation testInfo, moduleFilenames, String[] extraArgs)

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

void installUsingBundleTool(TestInformation testInfo, testAppFileNames)

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

void installer(TestInformation testInfo, testAppFileNames)

Thử cài đặt một gói hoặc chia nhỏ gói trên thiết bị.

boolean isPersistentApk(File filename, TestInformation testInfo)

Kiểm tra xem tệp APK có phải là một tệp APK cố định hay không.

ITestDevice.ApexInfo retrieveApexInfo(File testApexFile, DeviceDescriptor deviceDescriptor)

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

Trường

APEX_OFFSET

protected static final String APEX_SUFFIX

APK_ERROR

protected static final String APK_SUFFIX

SPLIT_APKS_OFFSET

protected static final String SPLIT_APKS_SUFFIX

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

Cài đặtApexModuleTarget Chuẩn bị

public InstallApexModuleTargetPreparer ()

Phương thức công khai

getModulesToInstall

public  getModulesToInstall (TestInformation testInfo)

Lấy các mô-đun phải được cài đặt trên tàu, dựa trên các mô-đun đã tải trước 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 sẽ được cài đặt trên thiết bị.

Gửi
DeviceNotAvailableException khi thiết bị không khả dụng.
TargetSetupError khi bạn không cài đặt các mô-đun bắt buộc hoặc mô-đun không thể được .

set bỏ qua nếu không được tải trước

public void setIgnoreIfNotPreloaded (boolean skip)

Tham số
skip boolean

đặtBỏ quaApexTearDown

public void setSkipApexTearDown (boolean skip)

Tham số
skip boolean

thiết lập

public void setUp (TestInformation testInfo)

Tham số
testInfo TestInformation

Gửi
BuildError
DeviceNotAvailableException
TargetSetupError

xé hình

public void tearDown (TestInformation testInfo, 
                Throwable e)

Tham số
testInfo TestInformation

e Throwable

Gửi
DeviceNotAvailableException

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

addApksToTestFiles

protected void addApksToTestFiles ()

thu thậpApexInfoFromApexModules

protected  collectApexInfoFromApexModules ( testAppFileNames, 
                TestInformation testInfo)

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

Tham số
testAppFileNames : Danh sách tên tệp của những mô-đun sẽ 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

chứa PersistentApk

protected boolean containsPersistentApk ( testAppFileNames, 
                TestInformation testInfo)

Kiểm tra xem tệp đầu vào có chứa bất kỳ APK cố định nào không.

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

testInfo TestInformation: TestInformation

Giá trị trả về
boolean true nếu các tệp đầu vào chứa mô-đun APK ổn định.

Gửi
DeviceNotAvailableException
TargetSetupError

Cài đặt getApk

protected  getApkInstalled ()

Giá trị trả về

getBundletoolFileName

protected String getBundletoolFileName ()

Giá trị trả về
String

getBundletoolUtil

protected BundletoolUtil getBundletoolUtil ()

Giá trị trả về
BundletoolUtil

getModuleTừ khoá TừApexPackageName

protected String getModuleKeywordFromApexPackageName (String packageName)

Xem từ khoá (ví dụ: "tzdata" cho com.android.tzdata.apex) từ tên gói apex.

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

Giá trị trả về
String a string Từ khoá của tên gói apex.

getModulesFailToKích hoạt

protected  getModulesFailToActivate ( activatedApexes)

Tải các mô-đun không kích hoạt được.

Tham số
activatedApexes : Tập hợp các apexe đang 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 được 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ề
Tệp[] 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 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 thể tìm thấy bundletool.

lượt cài đặt

protected void installTrain (TestInformation testInfo, 
                 moduleFilenames, 
                String[] extraArgs)

Cố gắng cài đặt một chuyến tàu đường chính có chứa đỉnh 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 dòng chính cần được .

extraArgs String

Gửi
DeviceNotAvailableException
TargetSetupError

cài đặtUseBundleTool

protected void installUsingBundleTool (TestInformation testInfo, 
                 testAppFileNames)

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

Tham số
testInfo TestInformation: TestInformation

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

Gửi
DeviceNotAvailableException
TargetSetupError

trình cài đặt

protected void installer (TestInformation testInfo, 
                 testAppFileNames)

Thử cài đặt một gói hoặc chia nhỏ gói trên thiết bị.

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

testAppFileNames : Tệp APK và gói đi kèm sẽ được cài đặt.

Gửi
DeviceNotAvailableException
TargetSetupError

Apk liên tục

protected boolean isPersistentApk (File filename, 
                TestInformation testInfo)

Kiểm tra xem tệp APK có phải là một tệp APK cố định hay không.

Tham số
filename File: Tệp mô-đun APK cần kiểm tra

testInfo TestInformation: TestInformation

Giá trị trả về
boolean true nếu đây là mô-đun APK ổn định.

Gửi
DeviceNotAvailableException
TargetSetupError

retrieveApexInfo

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

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

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

deviceDescriptor DeviceDescriptor

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

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