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


สรุป

ช่อง

protected static final String APEX_SUFFIX

protected static final String APK_SUFFIX

protected static final String SPLIT_APKS_SUFFIX

ช่างก่อสร้างสาธารณะ

InstallApexModuleTargetPreparer()

วิธีการสาธารณะ

getModulesToInstall(TestInformation testInfo)

รับโมดูลที่ควรติดตั้งบนรถไฟ โดยพิจารณาจากโมดูลที่โหลดไว้ล่วงหน้าใน อุปกรณ์

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

void tearDown(TestInformation testInfo, Throwable e)

วิธีการป้องกัน

void addApksToTestFiles()
collectApexInfoFromApexModules( testAppFileNames, TestInformation testInfo)

รวบรวมข้อมูลเอเพ็กซ์จากโมดูลเอเพ็กซ์สำหรับตรวจสอบการเปิดใช้งาน

boolean containsPersistentApk( testAppFileNames, TestInformation testInfo)

ตรวจสอบว่าไฟล์อินพุตมี APK แบบถาวรหรือไม่

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

รับคีย์เวิร์ด (เช่น "tzdata" สำหรับ com.android.tzdata.apex) จากชื่อแพ็กเกจ apex

getModulesFailToActivate( activatedApexes)

รับโมดูลที่เปิดใช้งานไม่สำเร็จ

getSplitsForApks(TestInformation testInfo, File moduleFile)

การแยกและการแยกการคืนสินค้าสำหรับ APK ที่ระบุ

void initBundletoolUtil(TestInformation testInfo)

เริ่มต้น Bundletool util สำหรับคลาสนี้

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

การพยายามติดตั้งรถไฟหลักที่มีจุดเอเพ็กซ์ในอุปกรณ์

void installUsingBundleTool(TestInformation testInfo, testAppFileNames)

พยายามติดตั้งโมดูลเมนไลน์โดยใช้ Bundletool

void installer(TestInformation testInfo, testAppFileNames)

พยายามติดตั้งแพ็กเกจหรือแยกแพ็กเกจบนอุปกรณ์

boolean isPersistentApk(File filename, TestInformation testInfo)

ตรวจสอบว่า apk เป็น apk ถาวรหรือไม่

ITestDevice.ApexInfo retrieveApexInfo(File testApexFile, DeviceDescriptor deviceDescriptor)

เรียกข้อมูล ApexInfo ที่มีpackageName และ versionCode จากไฟล์ apex ที่ระบุ

ช่อง

APEX_SUFFIX

protected static final String APEX_SUFFIX

APK_SUFFIX

protected static final String APK_SUFFIX

SPLIT_APKS_SUFFIX

protected static final String SPLIT_APKS_SUFFIX

ช่างก่อสร้างสาธารณะ

installApexModuleTargetPreparer

public InstallApexModuleTargetPreparer ()

วิธีการสาธารณะ

getModulesToInstall

public  getModulesToInstall (TestInformation testInfo)

รับโมดูลที่ควรติดตั้งบนรถไฟ โดยพิจารณาจากโมดูลที่โหลดไว้ล่วงหน้าใน อุปกรณ์ ระบบจะไม่ติดตั้งโมดูลที่ไม่ได้โหลดไว้ล่วงหน้า

พารามิเตอร์
testInfo TestInformation: TestInformation

คิกรีเทิร์น
รายการ โมดูลที่ควรติดตั้งในอุปกรณ์

การขว้าง
DeviceNotAvailableException เมื่ออุปกรณ์ไม่พร้อมใช้งาน
TargetSetupError เมื่อไม่มีการติดตั้งโมดูลที่จำเป็น หรือโมดูลไม่สามารถ ติดตั้งไว้แล้ว

ตั้งค่าละเว้นถ้าไม่โหลดล่วงหน้า

public void setIgnoreIfNotPreloaded (boolean skip)

พารามิเตอร์
skip boolean

ตั้งค่าข้ามApexTearDown

public void setSkipApexTearDown (boolean skip)

พารามิเตอร์
skip boolean

ตั้งค่า

public void setUp (TestInformation testInfo)

พารามิเตอร์
testInfo TestInformation

การขว้าง
BuildError
DeviceNotAvailableException
TargetSetupError

ฉีกขาด

public void tearDown (TestInformation testInfo, 
                Throwable e)

พารามิเตอร์
testInfo TestInformation

e Throwable

การขว้าง
DeviceNotAvailableException

วิธีการป้องกัน

addApksToTestFiles

protected void addApksToTestFiles ()

รวบรวมApexInfoFromApexModules

protected  collectApexInfoFromApexModules ( testAppFileNames, 
                TestInformation testInfo)

รวบรวมข้อมูลเอเพ็กซ์จากโมดูลเอเพ็กซ์สำหรับตรวจสอบการเปิดใช้งาน

พารามิเตอร์
testAppFileNames : รายการชื่อไฟล์ของโมดูลที่จะติดตั้ง

testInfo TestInformation: TestInformation

คิกรีเทิร์น
รายการที่มี apexinfo ของโมดูล apex ในรายการไฟล์อินพุต

การขว้าง
TargetSetupError

hasPersistentApk

protected boolean containsPersistentApk ( testAppFileNames, 
                TestInformation testInfo)

ตรวจสอบว่าไฟล์อินพุตมี APK แบบถาวรหรือไม่

พารามิเตอร์
testAppFileNames : รายการชื่อไฟล์ของโมดูลที่จะติดตั้ง

testInfo TestInformation: TestInformation

คิกรีเทิร์น
boolean trueหากไฟล์อินพุตมีโมดูล APK แบบถาวร

การขว้าง
DeviceNotAvailableException
TargetSetupError

getApkInstalled

protected  getApkInstalled ()

คิกรีเทิร์น

ชื่อไฟล์เครื่องมือของชุดเครื่องมือ

protected String getBundletoolFileName ()

คิกรีเทิร์น
String

GetBundletoolUtil

protected BundletoolUtil getBundletoolUtil ()

คิกรีเทิร์น
BundletoolUtil

getโมดูลคีย์เวิร์ดจากชื่อแพ็กเกจ

protected String getModuleKeywordFromApexPackageName (String packageName)

รับคีย์เวิร์ด (เช่น "tzdata" สำหรับ com.android.tzdata.apex) จากชื่อแพ็กเกจ apex

พารามิเตอร์
packageName String: ชื่อแพ็กเกจของไฟล์ apex

คิกรีเทิร์น
String สตริง คีย์เวิร์ดของชื่อแพ็กเกจเอเพ็กซ์

getModulesFailToActivate

protected  getModulesFailToActivate ( activatedApexes)

รับโมดูลที่เปิดใช้งานไม่สำเร็จ

พารามิเตอร์
activatedApexes : ชุดของเอเพ็กซ์ที่มีการใช้งานอยู่ในอุปกรณ์

คิกรีเทิร์น
รายการที่มี apexinfo ของโมดูลเอเพ็กซ์อินพุตที่เปิดใช้งานไม่สำเร็จ

การขว้าง
DeviceNotAvailableException
TargetSetupError

getSplitsForApk

protected  getSplitsForApks (TestInformation testInfo, 
                File moduleFile)

การแยกและการแยกการคืนสินค้าสำหรับ APK ที่ระบุ

พารามิเตอร์
testInfo TestInformation: TestInformation

moduleFile File: ไฟล์โมดูลที่จะใช้ดึงข้อมูลการแยก

คิกรีเทิร์น
a ไฟล์[] ที่มีการแยก

การขว้าง
TargetSetupError หากไม่พบ Bundletool หรือไฟล์ข้อมูลจำเพาะของอุปกรณ์ล้มเหลว

ยูทิลิตีของ initBundletool

protected void initBundletoolUtil (TestInformation testInfo)

เริ่มต้น Bundletool util สำหรับคลาสนี้

พารามิเตอร์
testInfo TestInformation: TestInformation สำหรับการเรียกใช้

การขว้าง
TargetSetupError หากไม่พบ Bundletool

ติดตั้งรถไฟ

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

การพยายามติดตั้งรถไฟหลักที่มีจุดเอเพ็กซ์ในอุปกรณ์

พารามิเตอร์
testInfo TestInformation: TestInformation

moduleFilenames : รายการสตริง รายการชื่อไฟล์ของโมดูลเมนไลน์ที่จะ ติดตั้งไว้แล้ว

extraArgs String

การขว้าง
DeviceNotAvailableException
TargetSetupError

ติดตั้งการใช้เครื่องมือแบบกลุ่ม

protected void installUsingBundleTool (TestInformation testInfo, 
                 testAppFileNames)

พยายามติดตั้งโมดูลเมนไลน์โดยใช้ Bundletool

พารามิเตอร์
testInfo TestInformation: TestInformation

testAppFileNames : ชื่อไฟล์ของโมดูลที่โหลดไว้ล่วงหน้าที่จะติดตั้ง

การขว้าง
DeviceNotAvailableException
TargetSetupError

โปรแกรมติดตั้ง

protected void installer (TestInformation testInfo, 
                 testAppFileNames)

พยายามติดตั้งแพ็กเกจหรือแยกแพ็กเกจบนอุปกรณ์

พารามิเตอร์
testInfo TestInformation: TestInformation สำหรับการเรียกใช้

testAppFileNames : APK และแพ็กเกจที่จะติดตั้ง

การขว้าง
DeviceNotAvailableException
TargetSetupError

isPersistentApk

protected boolean isPersistentApk (File filename, 
                TestInformation testInfo)

ตรวจสอบว่า apk เป็น apk ถาวรหรือไม่

พารามิเตอร์
filename File: ไฟล์โมดูล APK ที่ต้องตรวจสอบ

testInfo TestInformation: TestInformation

คิกรีเทิร์น
boolean true หากเป็นโมดูล APK แบบถาวร

การขว้าง
DeviceNotAvailableException
TargetSetupError

เรียกข้อมูล ApexInfo

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

เรียกข้อมูล ApexInfo ที่มีpackageName และ versionCode จากไฟล์ apex ที่ระบุ

พารามิเตอร์
testApexFile File: ไฟล์ apex ที่เราดึงข้อมูล

deviceDescriptor DeviceDescriptor

คิกรีเทิร์น
ITestDevice.ApexInfo ApexInfo ที่มีpackageName และ versionCode ของไฟล์ที่ระบุ

การขว้าง
TargetSetupError หากโปรแกรมแยกวิเคราะห์ aapt แยกวิเคราะห์ไฟล์ไม่สำเร็จ