Skip to content

Commit

Permalink
save_beta2
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhouYixun committed Nov 17, 2021
1 parent 53109f1 commit 7fdae01
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.jsoup.nodes.Element;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.DependsOn;
import org.springframework.stereotype.Component;

Expand All @@ -17,6 +18,7 @@
import java.io.LineNumberReader;
import java.util.List;

@ConditionalOnProperty(value = "modules.ios.enable", havingValue = "true")
@DependsOn({"iOSThreadPoolInit", "nettyMsgInit"})
@Component
public class LibIMobileDeviceTool {
Expand All @@ -27,6 +29,7 @@ public LibIMobileDeviceTool() {
}

public static void init() {
logger.info("开启iOS相关功能");
if (!System.getProperty("os.name").contains("Mac")) {
logger.info("iOS设备监听已关闭");
return;
Expand Down
54 changes: 8 additions & 46 deletions src/main/java/com/sonic/agent/tests/AndroidTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,29 +125,6 @@ public void run(JSONObject jsonObject) throws IOException {
}
continue;
}
// File logDec = new File("test-output/log");
// if (!logDec.exists()) {
// logDec.mkdirs();
// }
//写入logcat
// File logcatFile = new File(logDec + File.separator + Calendar.getInstance().getTimeInMillis() + "_" + udId + ".log");
// FileOutputStream logFileOut = null;
// try {
// logFileOut = new FileOutputStream(logcatFile);
// } catch (FileNotFoundException e) {
// logger.error(e.getMessage());
// }
// FileOutputStream finalLogFileOut = logFileOut;
//添加监听
// androidStepHandler.getAndroidDriver().addLogcatMessagesListener((msg) -> {
// try {
// finalLogFileOut.write((msg + "\n").getBytes(StandardCharsets.UTF_8));
// } catch (IOException e) {
// logger.error(e.getMessage());
// }
// });
//开始广播
// androidStepHandler.getAndroidDriver().startLogcatBroadcast("localhost", AppiumServer.service.getUrl().getPort());
Future<?> miniCapPro = null;
AtomicReference<List<byte[]>> imgList = new AtomicReference<>(new ArrayList<>());
AtomicReference<String[]> banner = new AtomicReference<>(new String[24]);
Expand All @@ -162,30 +139,15 @@ public void run(JSONObject jsonObject) throws IOException {
MiniCapTool miniCapTool = new MiniCapTool();
miniCapPro = miniCapTool.start(udId, banner, imgList, "high", -1, null);
}
//两分钟录一次
try {
Thread.sleep(120000);
} catch (InterruptedException e) {
logger.error(e.getMessage());
int w = 0;
while (w < 10 && (!runStep.isDone())) {
try {
Thread.sleep(10000);
} catch (InterruptedException e) {
logger.error(e.getMessage());
}
w++;
}
//移除监听
// androidStepHandler.getAndroidDriver().removeAllLogcatListeners();
//移除logcat广播
// androidStepHandler.getAndroidDriver().stopLogcatBroadcast();
//关闭流
// if (logFileOut != null) {
// try {
// logFileOut.close();
// } catch (IOException e) {
// logger.error(e.getMessage());
// }
// }
//处理logcat日志
// if (isFail.get()) {
// androidStepHandler.log.sendSelfLog(logcatFile.getName(), UploadTools.upload(logcatFile, "logFiles"));
// } else {
// logcatFile.delete();
// }
//处理录像
if (isSupportRecord) {
if (androidStepHandler.getStatus() == 3) {
Expand Down

0 comments on commit 7fdae01

Please sign in to comment.