【问题标题】:Non functional data for iOS mobile app visualisationiOS 移动应用可视化的非功能数据
【发布时间】:2020-04-29 12:50:25
【问题描述】:

就像在 Android 中一样,我们可以使用 Appium API 来捕获 CPU、内存和网络利用率等性能数据,并使用任何工具进行可视化。 有没有办法在 iOS 设备中捕获类似的性能数据并使用一些工具将其可视化

P.S - 我在 iOS 设备上使用过 Xcode 工具,但数据不容易解释,而且 .trace 数据格式与其他可视化工具不兼容。

【问题讨论】:

    标签: ios performance appium visualization


    【解决方案1】:

    正如您所提到的,iOS 应用程序的性能测试可以通过 Apple 与 Xcode 一起分发的 Instruments 进行。与 Apple 一样,您必须使用它。

    这正是 Appium 使用的方法:因为 1.8 版扩展了 iOS 应用程序分析的 mobile: command 接口并让您返回 Instruments .trace 文件:

    HashMap<String, Object> args = new HashMap<>();
    args.put("timeout", 60000);
    args.put("pid", "current");
    args.put("profileName", "Time Profiler");
    driver.executeScript("mobile: startPerfRecord", args);
    
    // perform any actions with Appium in your App
    
    args = new HashMap<>();
    args.put("profileName", "Time Profiler");
    String b64Zip = (String)driver.executeScript("mobile: stopPerfRecord", args);
    byte[] bytesZip = Base64.getMimeDecoder().decode(b64Zip);
    FileOutputStream stream = new FileOutputStream(traceZip);
    stream.write(bytesZip);
    

    您可以阅读更多详细信息here

    为了更好地理解跟踪日志解释,您可以查看以下开源项目,例如 TracedTraceUtilityThis answer 真的很有帮助

    【讨论】:

    • 感谢您的帮助,我已经尝试过那些 Traced/TracedUtility 项目,但它们似乎包含很多无法解决的问题。您看到解析/读取跟踪文件的任何其他方式可能是通过 Java 吗?
    • 我不知道 JAVA 中的任何跟踪实用程序可能是因为它不是 iOS 堆栈的一部分。我认为这些项目更像是概念验证,您必须实现自己的解析器 + 对报告工具的摄取
    猜你喜欢
    • 1970-01-01
    • 2012-12-10
    • 1970-01-01
    • 1970-01-01
    • 2023-01-10
    • 1970-01-01
    • 1970-01-01
    • 2019-12-12
    • 2016-02-07
    相关资源
    最近更新 更多