จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
installApexModuleTargetPreparer
public
class
InstallApexModuleTargetPreparer
extends SuiteApkInstaller
สรุป
ช่อง
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 ()
วิธีการสาธารณะ
public getModulesToInstall (TestInformation testInfo)
รับโมดูลที่ควรติดตั้งบนรถไฟ โดยพิจารณาจากโมดูลที่โหลดไว้ล่วงหน้าใน
อุปกรณ์ ระบบจะไม่ติดตั้งโมดูลที่ไม่ได้โหลดไว้ล่วงหน้า
คิกรีเทิร์น |
|
รายการ โมดูลที่ควรติดตั้งในอุปกรณ์ |
การขว้าง |
DeviceNotAvailableException |
เมื่ออุปกรณ์ไม่พร้อมใช้งาน |
TargetSetupError |
เมื่อไม่มีการติดตั้งโมดูลที่จำเป็น หรือโมดูลไม่สามารถ
ติดตั้งไว้แล้ว
|
ตั้งค่าละเว้นถ้าไม่โหลดล่วงหน้า
public void setIgnoreIfNotPreloaded (boolean skip)
ตั้งค่าข้ามApexTearDown
public void setSkipApexTearDown (boolean skip)
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 ()
protected collectApexInfoFromApexModules ( testAppFileNames,
TestInformation testInfo)
รวบรวมข้อมูลเอเพ็กซ์จากโมดูลเอเพ็กซ์สำหรับตรวจสอบการเปิดใช้งาน
พารามิเตอร์ |
testAppFileNames |
: รายการชื่อไฟล์ของโมดูลที่จะติดตั้ง |
testInfo |
TestInformation : TestInformation |
คิกรีเทิร์น |
|
รายการที่มี apexinfo ของโมดูล apex ในรายการไฟล์อินพุต
|
การขว้าง |
TargetSetupError |
|
protected boolean containsPersistentApk ( testAppFileNames,
TestInformation testInfo)
ตรวจสอบว่าไฟล์อินพุตมี APK แบบถาวรหรือไม่
พารามิเตอร์ |
testAppFileNames |
: รายการชื่อไฟล์ของโมดูลที่จะติดตั้ง |
testInfo |
TestInformation : TestInformation |
คิกรีเทิร์น |
boolean |
true หากไฟล์อินพุตมีโมดูล APK แบบถาวร
|
การขว้าง |
DeviceNotAvailableException |
|
TargetSetupError |
|
getApkInstalled
protected getApkInstalled ()
protected String getBundletoolFileName ()
getโมดูลคีย์เวิร์ดจากชื่อแพ็กเกจ
protected String getModuleKeywordFromApexPackageName (String packageName)
รับคีย์เวิร์ด (เช่น "tzdata" สำหรับ com.android.tzdata.apex) จากชื่อแพ็กเกจ apex
พารามิเตอร์ |
packageName |
String : ชื่อแพ็กเกจของไฟล์ apex |
คิกรีเทิร์น |
String |
สตริง คีย์เวิร์ดของชื่อแพ็กเกจเอเพ็กซ์
|
getModulesFailToActivate
protected getModulesFailToActivate ( activatedApexes)
รับโมดูลที่เปิดใช้งานไม่สำเร็จ
พารามิเตอร์ |
activatedApexes |
: ชุดของเอเพ็กซ์ที่มีการใช้งานอยู่ในอุปกรณ์ |
คิกรีเทิร์น |
|
รายการที่มี apexinfo ของโมดูลเอเพ็กซ์อินพุตที่เปิดใช้งานไม่สำเร็จ
|
การขว้าง |
DeviceNotAvailableException |
|
TargetSetupError |
|
protected getSplitsForApks (TestInformation testInfo,
File moduleFile)
การแยกและการแยกการคืนสินค้าสำหรับ APK ที่ระบุ
พารามิเตอร์ |
testInfo |
TestInformation : TestInformation |
moduleFile |
File : ไฟล์โมดูลที่จะใช้ดึงข้อมูลการแยก |
คิกรีเทิร์น |
|
a ไฟล์[] ที่มีการแยก |
การขว้าง |
TargetSetupError |
หากไม่พบ Bundletool หรือไฟล์ข้อมูลจำเพาะของอุปกรณ์ล้มเหลว
|
protected void initBundletoolUtil (TestInformation testInfo)
เริ่มต้น Bundletool util สำหรับคลาสนี้
การขว้าง |
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 |
|
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 แยกวิเคราะห์ไฟล์ไม่สำเร็จ
|
ตัวอย่างเนื้อหาและโค้ดในหน้าเว็บนี้ขึ้นอยู่กับใบอนุญาตที่อธิบายไว้ในใบอนุญาตการใช้เนื้อหา Java และ OpenJDK เป็นเครื่องหมายการค้าหรือเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2024-08-22 UTC
[[["เข้าใจง่าย","easyToUnderstand","thumb-up"],["แก้ปัญหาของฉันได้","solvedMyProblem","thumb-up"],["อื่นๆ","otherUp","thumb-up"]],[["ไม่มีข้อมูลที่ฉันต้องการ","missingTheInformationINeed","thumb-down"],["ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป","tooComplicatedTooManySteps","thumb-down"],["ล้าสมัย","outOfDate","thumb-down"],["ปัญหาเกี่ยวกับการแปล","translationIssue","thumb-down"],["ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด","samplesCodeIssue","thumb-down"],["อื่นๆ","otherDown","thumb-down"]],["อัปเดตล่าสุด 2024-08-22 UTC"],[],[]]