DexMetadataExtractor

public class DexMetadataExtractor
extends BaseTargetPreparer

java.lang.Object
   ↳ com.android.tradefed.targetprep.BaseTargetPreparer
     ↳ com.android.tradefed.targetprep.DexMetadataExtractor


為指定 APK 安裝 Dex 中繼資料檔案。

摘要

欄位

protected List<File> mDoInstallMultipleApks

公用建構函式

DexMetadataExtractor()

DexMetadataExtractor 的建構函式。

DexMetadataExtractor(IRunUtil runUtil)

公用方法

ITestDevice getDevice()

傳回準備者應套用的裝置。

void setAaptVersion(AaptParser.AaptVersion aaptVersion)

設定用於剖析 APK 的 AAPT 版本。

void setUp(TestInformation testInfo)

使用 profgen 從提供的 APK 擷取 Dex 中繼資料檔案,並與 APK 一併安裝。

void setUserId(int userId)

如果應為特定使用者安裝 APK,請設定要安裝的使用者 ID。

void tearDown(TestInformation testInfo, Throwable e)

受保護的方法

File getLocalPathForFilename(TestInformation testInfo, String apkFileName)
String parsePackageName(File testAppFile)

從測試應用程式取得套件名稱。

File resolveApkFile(TestInformation testInfo, File apkFile)

Helper to resolve an apk to its File.

欄位

mDoInstallMultipleApks

protected List<File> mDoInstallMultipleApks

公用建構函式

DexMetadataExtractor

public DexMetadataExtractor ()

DexMetadataExtractor 的建構函式。

DexMetadataExtractor

public DexMetadataExtractor (IRunUtil runUtil)

參數
runUtil IRunUtil

公用方法

getDevice

public ITestDevice getDevice ()

傳回準備者應套用的裝置。

傳回
ITestDevice

擲回
com.android.tradefed.targetprep.TargetSetupError
TargetSetupError

setAaptVersion

public void setAaptVersion (AaptParser.AaptVersion aaptVersion)

設定用於剖析 APK 的 AAPT 版本。

參數
aaptVersion AaptParser.AaptVersion

setUp

public void setUp (TestInformation testInfo)

使用 profgen 從提供的 APK 擷取 Dex 中繼資料檔案,並與 APK 一併安裝。

參數
testInfo TestInformation

擲回
BuildError、DeviceNotAvailableException
BuildError
DeviceNotAvailableException
TargetSetupError

setUserId

public void setUserId (int userId)

如果應為特定使用者安裝 APK,請設定要安裝的使用者 ID。

參數
userId int

tearDown

public void tearDown (TestInformation testInfo, 
                Throwable e)

參數
testInfo TestInformation

e Throwable

擲回
DeviceNotAvailableException

受保護的方法

getLocalPathForFilename

protected File getLocalPathForFilename (TestInformation testInfo, 
                String apkFileName)

參數
testInfo TestInformation

apkFileName String

傳回
File

擲回
TargetSetupError

parsePackageName

protected String parsePackageName (File testAppFile)

從測試應用程式取得套件名稱。

參數
testAppFile File

傳回
String

擲回
TargetSetupError

resolveApkFile

protected File resolveApkFile (TestInformation testInfo, 
                File apkFile)

Helper 可將 APK 解析為檔案。

參數
testInfo TestInformation

apkFile File

傳回
File

擲回
DeviceNotAvailableException
TargetSetupError