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 与模块文件一起从未捆绑的模块分支下载。
概括
公共方法 |
---|
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。 |
公共构造函数
public BundletoolUtil (File bundletoolJar)
公共方法
从 Apks 中提取拆分
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 :构建工件信息 |
生成设备规格文件
public String generateDeviceSpecFile (ITestDevice device)
为连接的设备配置生成 JSON 文件。
参数 |
---|
device | ITestDevice :连接的设备 |
安装Apks
public void installApks (File apks,
ITestDevice device)
使用bundletool安装apk .apks。
参数 |
---|
apks | File :需要安装的apk |
device | ITestDevice :连接的设备 |
受保护的方法
获取AdbPath
protected String getAdbPath ()
protected File getBundletoolFile ()
获取运行工具
protected IRunUtil getRunUtil ()