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 | |||
요약
상수 | |
|---|---|
String |
APEX_OPTION
|
String |
APEX_SUFFIX
|
String |
APK_SUFFIX
|
String |
APK_ZIP_OPTION
|
String |
CHILD_SESSION_CREATION_CMD
|
String |
PARENT_SESSION_CREATION_CMD
|
String |
ROLLBACK_STATE_COMMITTED
|
String |
ROLLBACK_STATE_UNKNOWN
|
String |
SPLIT_APKS_SUFFIX
|
필드 | |
|---|---|
protected
File |
mTrainFolderPath
|
공개 생성자 | |
|---|---|
InstallApexModuleTargetPreparer()
|
|
공개 메서드 | |
|---|---|
List<File>
|
getModulesToInstall(TestInformation testInfo)
기기에 미리 로드된 모듈을 기반으로 트레인에 설치해야 하는 모듈을 가져옵니다. |
void
|
setIgnoreIfNotPreloaded(boolean skip)
|
void
|
setSkipApexTearDown(boolean skip)
|
void
|
setUp(TestInformation testInfo)
|
void
|
tearDown(TestInformation testInfo, Throwable e)
|
보호된 메서드 | |
|---|---|
void
|
addApksToTestFiles()
|
void
|
addStagedReadyTimeoutForAdb(List<String> cmd)
|
void
|
addTimeoutMillisForBundletool(List<String> extraArgs)
|
void
|
checkApexActivation(ITestDevice device)
모든 apex가 활성화되어 있는지 확인합니다. |
List<ITestDevice.ApexInfo>
|
collectApexInfoFromApexModules(Map<File, String> testAppFileNames, TestInformation testInfo)
활성화 확인을 위해 apex 모듈에서 apex 정보를 수집합니다. |
List<String>
|
getApkInstalled()
|
String
|
getBundletoolFileName()
|
BundletoolUtil
|
getBundletoolUtil()
|
String
|
getModuleKeywordFromApexPackageName(String packageName)
apex 패키지 이름에서 키워드 (예: com.android.tzdata.apex의 경우 'tzdata')를 가져옵니다. |
List<ITestDevice.ApexInfo>
|
getModulesFailToActivate(Set<ITestDevice.ApexInfo> activatedApexes)
활성화되지 않은 모듈을 가져옵니다. |
List<File>
|
getSplitsForApks(TestInformation testInfo, File moduleFile)
지정된 APK의 분할을 추출하여 반환합니다. |
void
|
initBundletoolUtil(TestInformation testInfo)
이 클래스의 bundletool 유틸리티를 초기화합니다. |
void
|
installTrain(TestInformation testInfo, List<File> moduleFilenames)
기기에 apex가 포함된 메인라인 트레인을 설치하려고 시도합니다. |
void
|
installUsingBundleTool(TestInformation testInfo, List<File> testAppFileNames)
bundletool을 사용하여 메인라인 모듈을 설치하려고 시도합니다. |
void
|
installer(TestInformation testInfo, Map<File, String> testAppFileNames)
기기에 패키지 또는 분할 패키지를 설치하려고 시도합니다. |
ITestDevice.ApexInfo
|
retrieveApexInfo(File testApexFile, DeviceDescriptor deviceDescriptor)
지정된 apex 파일에서 packageName과 versionCode이 포함된 ApexInfo를 가져옵니다. |
상수
APEX_OPTION
protected static final String APEX_OPTION
상수 값: '--apex'
APEX_SUFFIX
protected static final String APEX_SUFFIX
상수 값: ".apex"
APK_SUFFIX
protected static final String APK_SUFFIX
상수 값: ".apk"
APK_ZIP_OPTION
protected static final String APK_ZIP_OPTION
상수 값: '--apks-zip'
CHILD_SESSION_CREATION_CMD
protected static final String CHILD_SESSION_CREATION_CMD
상수 값: 'pm install-create'
PARENT_SESSION_CREATION_CMD
protected static final String PARENT_SESSION_CREATION_CMD
상수 값: 'pm install-create --multi-package'
ROLLBACK_STATE_COMMITTED
public static final String ROLLBACK_STATE_COMMITTED
상수 값: 'committed'
ROLLBACK_STATE_UNKNOWN
public static final String ROLLBACK_STATE_UNKNOWN
상수 값: 'unknown'
SPLIT_APKS_SUFFIX
protected static final String SPLIT_APKS_SUFFIX
상수 값: ".apks"
필드
mTrainFolderPath
protected File mTrainFolderPath
공개 생성자
InstallApexModuleTargetPreparer
public InstallApexModuleTargetPreparer ()
공개 메서드
getModulesToInstall
public List<File> getModulesToInstall (TestInformation testInfo)
기기에 미리 로드된 모듈을 기반으로 트레인에 설치해야 하는 모듈을 가져옵니다. 미리 로드되지 않은 모듈은 설치되지 않습니다.
| 매개변수 | |
|---|---|
testInfo |
TestInformation: TestInformation |
| 반환 | |
|---|---|
List<File> |
기기에 설치해야 하는 모듈 목록 |
| 생성 값 | |
|---|---|
DeviceNotAvailableException |
기기를 사용할 수 없는 경우 |
TargetSetupError |
필수 모듈이 설치되지 않았거나 모듈을 설치할 수 없는 경우 |
setIgnoreIfNotPreloaded
public void setIgnoreIfNotPreloaded (boolean skip)
| 매개변수 | |
|---|---|
skip |
boolean |
setSkipApexTearDown
public void setSkipApexTearDown (boolean skip)
| 매개변수 | |
|---|---|
skip |
boolean |
setUp
public void setUp (TestInformation testInfo)
| 매개변수 | |
|---|---|
testInfo |
TestInformation |
| 생성 값 | |
|---|---|
BuildError |
|
DeviceNotAvailableException |
|
TargetSetupError |
|
tearDown
public void tearDown (TestInformation testInfo, Throwable e)
| 매개변수 | |
|---|---|
testInfo |
TestInformation |
e |
Throwable |
| 생성 값 | |
|---|---|
DeviceNotAvailableException |
|
DeviceRuntimeException |
|
보호된 메서드
addApksToTestFiles
protected void addApksToTestFiles ()
addStagedReadyTimeoutForAdb
protected void addStagedReadyTimeoutForAdb (List<String> cmd)
| 매개변수 | |
|---|---|
cmd |
List |
addTimeoutMillisForBundletool
protected void addTimeoutMillisForBundletool (List<String> extraArgs)
| 매개변수 | |
|---|---|
extraArgs |
List |
checkApexActivation
protected void checkApexActivation (ITestDevice device)
모든 apex가 활성화되어 있는지 확인합니다.
| 매개변수 | |
|---|---|
device |
ITestDevice: 테스트 중입니다. |
| 생성 값 | |
|---|---|
TargetSetupError |
활성화에 실패한 경우 |
DeviceNotAvailableException |
|
collectApexInfoFromApexModules
protected List<ITestDevice.ApexInfo> collectApexInfoFromApexModules (Map<File, String> testAppFileNames, TestInformation testInfo)
활성화 확인을 위해 apex 모듈에서 apex 정보를 수집합니다.
| 매개변수 | |
|---|---|
testAppFileNames |
Map: 설치할 모듈의 파일 이름 목록입니다. |
testInfo |
TestInformation: TestInformation |
| 반환 | |
|---|---|
List<ITestDevice.ApexInfo> |
입력 파일 목록에 있는 apex 모듈의 apexinfo가 포함된 목록 |
| 생성 값 | |
|---|---|
TargetSetupError |
|
getApkInstalled
protected List<String> getApkInstalled ()
| 반환 | |
|---|---|
List<String> |
|
getBundletoolFileName
protected String getBundletoolFileName ()
| 반환 | |
|---|---|
String |
|
getModuleKeywordFromApexPackageName
protected String getModuleKeywordFromApexPackageName (String packageName)
apex 패키지 이름에서 키워드 (예: com.android.tzdata.apex의 경우 'tzdata')를 가져옵니다.
| 매개변수 | |
|---|---|
packageName |
String: apex 파일의 패키지 이름입니다. |
| 반환 | |
|---|---|
String |
문자열 Apex 패키지 이름의 키워드입니다. |
getModulesFailToActivate
protected List<ITestDevice.ApexInfo> getModulesFailToActivate (Set<ITestDevice.ApexInfo> activatedApexes)
활성화되지 않은 모듈을 가져옵니다.
| 매개변수 | |
|---|---|
activatedApexes |
Set: 기기에서 활성 상태인 꼭짓점 집합 |
| 반환 | |
|---|---|
List<ITestDevice.ApexInfo> |
활성화되지 않은 입력 Apex 모듈의 apexinfo가 포함된 목록 |
| 생성 값 | |
|---|---|
DeviceNotAvailableException |
|
TargetSetupError |
|
getSplitsForApks
protected List<File> getSplitsForApks (TestInformation testInfo, File moduleFile)
지정된 APK의 분할을 추출하여 반환합니다.
| 매개변수 | |
|---|---|
testInfo |
TestInformation: TestInformation |
moduleFile |
File: 분할을 추출할 모듈 파일입니다. |
| 반환 | |
|---|---|
List<File> |
분할이 포함된 File[] |
| 생성 값 | |
|---|---|
TargetSetupError |
bundletool을 찾을 수 없거나 기기 사양 파일을 생성할 수 없는 경우 |
initBundletoolUtil
protected void initBundletoolUtil (TestInformation testInfo)
이 클래스의 bundletool 유틸리티를 초기화합니다.
| 매개변수 | |
|---|---|
testInfo |
TestInformation: 호출의 TestInformation입니다. |
| 생성 값 | |
|---|---|
TargetSetupError |
bundletool을 찾을 수 없는 경우 |
installTrain
protected void installTrain (TestInformation testInfo, List<File> moduleFilenames)
기기에 apex가 포함된 메인라인 트레인을 설치하려고 시도합니다.
| 매개변수 | |
|---|---|
testInfo |
TestInformation: TestInformation |
moduleFilenames |
List: 문자열 목록입니다. 설치할 메인라인 모듈의 파일 이름 목록입니다. |
| 생성 값 | |
|---|---|
DeviceNotAvailableException |
|
TargetSetupError |
|
installUsingBundleTool
protected void installUsingBundleTool (TestInformation testInfo, List<File> testAppFileNames)
bundletool을 사용하여 메인라인 모듈을 설치하려고 시도합니다.
| 매개변수 | |
|---|---|
testInfo |
TestInformation: TestInformation |
testAppFileNames |
List: 설치할 미리 로드된 모듈의 파일 이름입니다. |
| 생성 값 | |
|---|---|
DeviceNotAvailableException |
|
TargetSetupError |
|
설치 사용자 수
protected void installer (TestInformation testInfo, Map<File, String> testAppFileNames)
기기에 패키지 또는 분할 패키지를 설치하려고 시도합니다.
| 매개변수 | |
|---|---|
testInfo |
TestInformation: 호출의 TestInformation |
testAppFileNames |
Map: 설치할 APK와 패키지입니다. |
| 생성 값 | |
|---|---|
DeviceNotAvailableException |
|
TargetSetupError |
|
retrieveApexInfo
protected ITestDevice.ApexInfo retrieveApexInfo (File testApexFile, DeviceDescriptor deviceDescriptor)
지정된 apex 파일에서 packageName과 versionCode이 포함된 ApexInfo를 가져옵니다.
| 매개변수 | |
|---|---|
testApexFile |
File: 정보를 가져올 apex 파일입니다. |
deviceDescriptor |
DeviceDescriptor |
| 반환 | |
|---|---|
ITestDevice.ApexInfo |
지정된 파일의 packageName과 versionCode이 포함된 ApexInfo |
| 생성 값 | |
|---|---|
TargetSetupError |
aapt 파서가 파일을 파싱하지 못한 경우 |