【问题标题】:How to retrieve the ios device screen resolution from the simctl command line如何从 simctl 命令行检索 ios 设备屏幕分辨率
【发布时间】:2020-06-19 13:23:13
【问题描述】:

我正在寻找一种通过xcrun simctl 命令行检索设备屏幕分辨率的方法。

我尝试使用xcrun simctl list -j devicetypes 列出设备类型,但不幸的是分辨率没有存储在那里...

有什么想法吗?

【问题讨论】:

    标签: ios command-line ios-simulator screen-resolution simctl


    【解决方案1】:

    感谢 CodeBender 解决方案,我通过挖掘找到了一种方法,xcrun simctl io

    以这种方式使用它(其中 UDID 是您想要的设备):

    xcrun simctl io 80E6DAF5-A6EE-44F5-AAE6-561D58652C31 enumerate
    

    它立即返回:

    Port:
        UUID: 246D47F3-7BDA-42DE-B511-0C1BD0C1EBCF
        Class: Display
        Port Identifier: com.apple.CoreSimulator.IndigoFramebufferServices.Display
        Power state: On
        Display class: 0
        Default width: 640
        Default height: 1136
        Default pixel format: 'BGRA'
        Display rotation:
            Angle              = 0 radians
    

    【讨论】:

    • 很好,很高兴你找到了更好的方法
    • 谢谢你! (你应该留下你的答案,我觉得这也很有趣)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-06-14
    • 1970-01-01
    相关资源
    最近更新 更多