Stay organized with collections
Save and categorize content based on your preferences.
public
class
BundletoolUtil
extends Object
java.lang.Object
|
↳ |
com.android.tradefed.util.BundletoolUtil
|
Utility class that uses bundletool command line to install the .apks on deivce. Bundletool doc
link: https://developer.android.com/studio/command-line/bundletool The bundletool.jar is
downloaded from the unbundled module branch together with the module file.
Summary
Public methods |
File
|
extractSplitsFromApks(File apks, String deviceSpecPath, ITestDevice device, IBuildInfo buildInfo)
Extracts the split apk/apex from .apks.
|
String
|
generateDeviceSpecFile(ITestDevice device)
Generates a JSON file for a connected device configuration.
|
void
|
installApks(File apks, ITestDevice device)
Installs the apk .apks that using bundletool.
|
Public constructors
public BundletoolUtil (File bundletoolJar)
Parameters |
bundletoolJar |
File |
Public methods
extractSplitsFromApks
public File extractSplitsFromApks (File apks,
String deviceSpecPath,
ITestDevice device,
IBuildInfo buildInfo)
Extracts the split apk/apex from .apks. Renames the splits and stores the splits to the
directory where .apks stored. Returns the new directory that the splits stored.
Parameters |
apks |
File : the apks that need to be extracted |
deviceSpecPath |
String : the device spec file that bundletool uses to extract the apks |
device |
ITestDevice : the connected device |
buildInfo |
IBuildInfo : build artifact information |
Returns |
File |
a ERROR(/File) that is the directory where the extracted apk(s)/apex live under
|
generateDeviceSpecFile
public String generateDeviceSpecFile (ITestDevice device)
Generates a JSON file for a connected device configuration.
Parameters |
device |
ITestDevice : the connected device |
Returns |
String |
a String representing the path of the device specification file.
|
installApks
public void installApks (File apks,
ITestDevice device)
Installs the apk .apks that using bundletool.
Parameters |
apks |
File : the apks that need to be installed |
device |
ITestDevice : the connected device
|
Protected methods
getAdbPath
protected String getAdbPath ()
protected File getBundletoolFile ()
getRunUtil
protected IRunUtil getRunUtil ()
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2022-08-03 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2022-08-03 UTC."],[],[]]