Appium-如何使用java从iOS设备读取日志
我正在尝试使用appium和java自动化iOS应用程序测试。我能够在/Users/xyz/Library/Logs/CoreSimulator/158d9eddabacdefyt586a334136/system.log读取为模拟器生成的日志文件 在真实设备上运行测试时,在哪里可以找到日志?我认为现在唯一的方法是在xcode上Appium-如何使用java从iOS设备读取日志,java,ios,webdriver,appium,Java,Ios,Webdriver,Appium,我正在尝试使用appium和java自动化iOS应用程序测试。我能够在/Users/xyz/Library/Logs/CoreSimulator/158d9eddabacdefyt586a334136/system.log读取为模拟器生成的日志文件 在真实设备上运行测试时,在哪里可以找到日志?我认为现在唯一的方法是在xcode上 有没有人面对过这个问题,可以指导我 这可能会有帮助[在Android中确实有效]: List<LogEntry> logEntries = driver.m
有没有人面对过这个问题,可以指导我 这可能会有帮助[在Android中确实有效]:
List<LogEntry> logEntries = driver.manage().logs().get("logcat").getAll();
for (LogEntry entry : logEntries) {
if (entry.getMessage().contains(event)) { //
System.out.println("Found the logs looking for.");
}
}
List logEntries=driver.manage().logs().get(“logcat”).getAll();
用于(日志条目:日志条目){
如果(entry.getMessage().contains(event)){//
System.out.println(“找到要查找的日志”);
}
}
进一步挖掘,我可以发现这一点,在课程中可能会有所帮助:
package io.appium.java_client.service.local.flags;
public enum IOSServerFlag implements ServerArgument{
...
/**
* if set, the iOS system log will be written to the console<br/>
* Default: false
*/
SHOW_IOS_LOG("--show-ios-log"),
...
}
包io.appium.java_client.service.local.flags;
公共枚举IOSServerFlag实现服务器参数{
...
/**
*如果设置,iOS系统日志将写入控制台
*默认值:false
*/
显示IOS日志(“--SHOW IOS LOG”),
...
}
这里也有:如果您想查看日志,那么可以使用libimobiledevice库或lemonjar。Libimobiledevice比lemonjar好得多。尽管处于测试阶段<代码>驱动程序.manage().logs()可能会对您有所帮助。