fix: ASW-176 exec playbook 接口增加reInstall,clearCache,unInstall参数
This commit is contained in:
@@ -845,6 +845,47 @@ public class AdbUtil {
|
||||
return new CommandResult(T.StrUtil.isNotEmpty(result) ? 1 : 0, result);
|
||||
}
|
||||
|
||||
|
||||
public boolean findPackageInstall(String packageName) {
|
||||
String result = commandExec.exec(AdbCommandBuilder.builder()
|
||||
.serial(this.getSerial())
|
||||
.buildCheckPackage(packageName)
|
||||
.build()
|
||||
);
|
||||
|
||||
return T.StrUtil.equals(result, packageName);
|
||||
}
|
||||
|
||||
|
||||
public List findPackageNameList() {
|
||||
String result = commandExec.exec(AdbCommandBuilder.builder()
|
||||
.serial(this.getSerial())
|
||||
.buildFindPackageNameList()
|
||||
.build()
|
||||
);
|
||||
List<String> packageNameList = T.ListUtil.list(true);
|
||||
|
||||
String prefix = "package:";
|
||||
String[] lines = result.split("\\n");
|
||||
for (String line : lines) {
|
||||
String packageName = T.StrUtil.trim(line.substring(prefix.length()));
|
||||
if (T.StrUtil.equals(DEFAULT_DROIDVNC_NG_PKG_NAME, packageName)) continue;
|
||||
packageNameList.add(packageName);
|
||||
}
|
||||
return packageNameList;
|
||||
}
|
||||
|
||||
|
||||
public CommandResult startApp(String packageName) {
|
||||
String result = commandExec.exec(AdbCommandBuilder.builder()
|
||||
.serial(this.getSerial())
|
||||
.buildStartAPP(packageName)
|
||||
.build()
|
||||
);
|
||||
log.info("[startApp] [result: {}]", result);
|
||||
return new CommandResult(T.StrUtil.isNotEmpty(result) ? 1 : 0, result);
|
||||
}
|
||||
|
||||
private synchronized ExecutorService getThreadPool() {
|
||||
if (threadPool == null) {
|
||||
threadPool = new ThreadPoolExecutor(
|
||||
|
||||
Reference in New Issue
Block a user