BundletoolUtil

public class BundletoolUtil
extends Object

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


使用 bundletool 指令列在 Deivce 上安裝 .apk 的公用程式類別。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)

安裝使用 bundletool 的 apk .apk。

保護方法

String getAdbPath()
File getBundletoolFile()
IRunUtil getRunUtil()

公用建構函式

BundletoolUtil

public BundletoolUtil (File bundletoolJar)

參數
bundletoolJar File

公用方法

擷取 SplitsFromApks

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 所在的目錄 ERROR(/File)

generateDeviceSpecFile

public String generateDeviceSpecFile (ITestDevice device)

產生已連結裝置設定的 JSON 檔案。

參數
device ITestDevice:已連結的裝置

傳回
String 代表裝置規格檔案路徑的 String

installApks

public void installApks (File apks, 
                ITestDevice device)

安裝使用 bundletool 的 apk .apk。

參數
apks File:需要安裝的 APK

device ITestDevice:已連結的裝置

擲回
TargetSetupError

保護方法

getAdbPath

protected String getAdbPath ()

傳回
String

getBundletoolFile

protected File getBundletoolFile ()

傳回
File

getRunUtil

protected IRunUtil getRunUtil ()

傳回
IRunUtil