BundletoolUtil
public
class
BundletoolUtil
extends Object
| java.lang.Object | |
| ↳ | com.android.tradefed.util.BundletoolUtil |
bundletool コマンドラインを使用してデバイスに .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 .apks をインストールします。 |
void
|
installApks(File apks, ITestDevice device)
bundletool を使用して APK .apks をインストールします。 |
void
|
installApksFromZip(File apksZip, ITestDevice device,
指定された ZIP ファイルに含まれる APK をインストールします。 |
保護されたメソッド | |
|---|---|
String
|
getAdbPath()
|
File
|
getBundletoolFile()
|
IRunUtil
|
getRunUtil()
|
static
long
|
parseCmdTimeout(
|
パブリック コンストラクタ
BundletoolUtil
public BundletoolUtil (File bundletoolJar)
| パラメータ | |
|---|---|
bundletoolJar |
File |
パブリック メソッド
extractSplitsFromApks
public File extractSplitsFromApks (File apks,
String deviceSpecPath,
ITestDevice device,
IBuildInfo buildInfo).apks から分割 APK/apex を抽出します。スプリットの名前を変更し、.apk が保存されているディレクトリにスプリットが保存されます。分割が保存された新しいディレクトリを返します。
| パラメータ | |
|---|---|
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,
extraArgs) bundletool を使用して APK .apks をインストールします。
| パラメータ | |
|---|---|
apks |
File: インストールが必要な APK |
device |
ITestDevice: 接続されたデバイス |
extraArgs |
: 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,
extraArgs) 指定された ZIP ファイルに含まれる APK をインストールします。
| パラメータ | |
|---|---|
apksZip |
File: インストールする zip ファイル |
device |
ITestDevice: 接続されたデバイス |
extraArgs |
: bundletool install コマンドに渡す追加の引数 |
| 例外 | |
|---|---|
TargetSetupError |
|
保護されたメソッド
getAdbPath
protected String getAdbPath ()
| 戻り値 | |
|---|---|
String |
|
getBundletoolFile
protected File getBundletoolFile ()
| 戻り値 | |
|---|---|
File |
|
parseCmdTimeout
protected static long parseCmdTimeout (args, long defaultValue)
| パラメータ | |
|---|---|
args |
|
defaultValue |
long |
| 戻り値 | |
|---|---|
long |
|
| 例外 | |
|---|---|
TargetSetupError |
|