wda日志打印优化
parent
ac729d46c1
commit
fd88ef376a
|
@ -75,7 +75,7 @@ public class WindowsAndLinuxIosDeviceInitThread extends IosDeviceInitThread {
|
||||||
cmds.add("tidevice");
|
cmds.add("tidevice");
|
||||||
cmds.add("-u");
|
cmds.add("-u");
|
||||||
cmds.add(phone.getUdid());
|
cmds.add(phone.getUdid());
|
||||||
cmds.add("xcuitest");
|
cmds.add("xctest");
|
||||||
cmds.add("-B");
|
cmds.add("-B");
|
||||||
cmds.add(appPackage);
|
cmds.add(appPackage);
|
||||||
cmds.add("--debug");
|
cmds.add("--debug");
|
||||||
|
@ -92,12 +92,18 @@ public class WindowsAndLinuxIosDeviceInitThread extends IosDeviceInitThread {
|
||||||
try {
|
try {
|
||||||
fileOutputStream = new FileOutputStream(wdaLogFile);
|
fileOutputStream = new FileOutputStream(wdaLogFile);
|
||||||
this.wdaProcess = processBuilder.start();
|
this.wdaProcess = processBuilder.start();
|
||||||
|
if (UpperComputerManager.getInstance().getOperatingSystem().startsWith("Windows")) {
|
||||||
|
input = new LineNumberReader(new InputStreamReader(this.wdaProcess.getInputStream(),"GBK"));
|
||||||
|
} else if (UpperComputerManager.getInstance().getOperatingSystem().startsWith("Linux")) {
|
||||||
|
input = new LineNumberReader(new InputStreamReader(this.wdaProcess.getInputStream(),"UTF-8"));
|
||||||
|
}
|
||||||
input = new LineNumberReader(new InputStreamReader(this.wdaProcess.getInputStream()));
|
input = new LineNumberReader(new InputStreamReader(this.wdaProcess.getInputStream()));
|
||||||
String line = null;
|
String line = null;
|
||||||
while (null != (line = input.readLine())) {
|
while (null != (line = input.readLine())) {
|
||||||
// logger.debug("设备【{}】wda程序打印:{}", phone.getUdid(), line);
|
if (line.contains(" _device")) {
|
||||||
fileOutputStream.write(line.getBytes(StandardCharsets.UTF_8));
|
fileOutputStream.write(line.getBytes(StandardCharsets.UTF_8));
|
||||||
fileOutputStream.write(10);
|
fileOutputStream.write(10);
|
||||||
|
}
|
||||||
if (line.contains(SUCCESS_FLAG)) {
|
if (line.contains(SUCCESS_FLAG)) {
|
||||||
logger.info("设备【{}】的wda程序启动成功,开启nkAgent。。。。。。。。。", phone.getUdid());
|
logger.info("设备【{}】的wda程序启动成功,开启nkAgent。。。。。。。。。", phone.getUdid());
|
||||||
createNKAgent();
|
createNKAgent();
|
||||||
|
|
Loading…
Reference in New Issue