fix: 以 tid 为目录保留 playbook 文件,apk ,pcap 及playbook 运行日志

This commit is contained in:
zhangshuai
2024-10-18 17:17:53 +08:00
parent 05bacb1bf3
commit 562ac17fd4
3 changed files with 53 additions and 35 deletions

View File

@@ -511,6 +511,20 @@ public class AdbUtil {
return new CommandResult(T.StrUtil.containsAny(result, "Success") ? 0 : 1, result);
}
/**
* stop app
* adb shell am force-stop package_name
*/
public CommandResult stopApp(String packageName) {
String result = CommandExec.exec(AdbCommandBuilder.builder()
.serial(this.getSerial())
.buildStopAppCommand(packageName)
.build()
);
log.info("[stopApp] [packageName: {}] [result: {}]", packageName, result);
return new CommandResult(T.StrUtil.isEmpty(result) ? 0 : 1, result);
}
/**
* iptables -F
* iptables -X