BundletoolUtil

public class BundletoolUtil
extends Object

java.lang.Object
   ↳ com.android.tradefed.util.BundletoolUtil


bundletool 명령줄을 사용하여 기기에 .apks를 설치하는 유틸리티 클래스 Bundletool 문서 링크: https://developer.android.com/studio/command-line/bundletool bundletool.jar는 번들 해제된 모듈 브랜치에서 모듈 파일과 함께 다운로드됩니다.

요약

공개 생성자

BundletoolUtil(File bundletoolJar)

공개 메서드

File extractSplitsFromApks(File apks, String deviceSpecPath, ITestDevice device, IBuildInfo buildInfo)

.apks에서 분할 APK/apex를 추출합니다.

String generateDeviceSpecFile(ITestDevice device)

연결된 기기 구성의 JSON 파일을 생성합니다.

void installApks(File apks, ITestDevice device, List<String> extraArgs)

bundletool을 사용하는 APK .apks를 설치합니다.

void installApks(File apks, ITestDevice device)

bundletool을 사용하는 APK .apks를 설치합니다.

void installApksFromZip(File apksZip, ITestDevice device, List<String> extraArgs)

제공된 zip 파일에 포함된 APK를 설치합니다.

보호된 메서드

String getAdbPath()
File getBundletoolFile()
IRunUtil getRunUtil()
static long parseCmdTimeout(List<String> args, long defaultValue)

공개 생성자

BundletoolUtil

public BundletoolUtil (File bundletoolJar)

매개변수
bundletoolJar File

공개 메서드

extractSplitsFromApks

public File extractSplitsFromApks (File apks, 
                String deviceSpecPath, 
                ITestDevice device, 
                IBuildInfo buildInfo)

.apks에서 분할 APK/apex를 추출합니다. 분할의 이름을 바꾸고 .apks가 저장된 디렉터리에 분할을 저장합니다. 분할이 저장된 새 디렉터리를 반환합니다.

매개변수
apks File: 추출해야 하는 APK

deviceSpecPath String: bundletool이 APK를 추출하는 데 사용하는 기기 사양 파일

device ITestDevice: 연결된 기기

buildInfo IBuildInfo: 빌드 아티팩트 정보

반환
File 추출된 APK/apex가 있는 디렉터리인 File

generateDeviceSpecFile

public String generateDeviceSpecFile (ITestDevice device)

연결된 기기 구성의 JSON 파일을 생성합니다.

매개변수
device ITestDevice: 연결된 기기

반환
String 기기 사양 파일의 경로를 나타내는 String

생성 값
IOException

installApks

public void installApks (File apks, 
                ITestDevice device, 
                List<String> extraArgs)

bundletool을 사용하는 APK .apks를 설치합니다.

매개변수
apks File: 설치해야 하는 APK

device ITestDevice: 연결된 기기

extraArgs List: bundletool 명령어

생성 값
TargetSetupError

installApks

public void installApks (File apks, 
                ITestDevice device)

bundletool을 사용하는 APK .apks를 설치합니다.

매개변수
apks File: 설치해야 하는 APK

device ITestDevice: 연결된 기기

생성 값
TargetSetupError

installApksFromZip

public void installApksFromZip (File apksZip, 
                ITestDevice device, 
                List<String> extraArgs)

제공된 zip 파일에 포함된 APK를 설치합니다.

매개변수
apksZip File: 설치할 zip 파일

device ITestDevice: 연결된 기기

extraArgs List: bundletool install 명령어에 전달할 추가 인수

생성 값
TargetSetupError

보호된 메서드

getAdbPath

protected String getAdbPath ()

반환
String

getBundletoolFile

protected File getBundletoolFile ()

반환
File

getRunUtil

protected IRunUtil getRunUtil ()

반환
IRunUtil

parseCmdTimeout

protected static long parseCmdTimeout (List<String> args, 
                long defaultValue)

매개변수
args List

defaultValue long

반환
long

생성 값
TargetSetupError