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