【发布时间】:2020-06-19 13:23:13
【问题描述】:
我正在寻找一种通过xcrun simctl 命令行检索设备屏幕分辨率的方法。
我尝试使用xcrun simctl list -j devicetypes 列出设备类型,但不幸的是分辨率没有存储在那里...
有什么想法吗?
【问题讨论】:
标签: ios command-line ios-simulator screen-resolution simctl
我正在寻找一种通过xcrun simctl 命令行检索设备屏幕分辨率的方法。
我尝试使用xcrun simctl list -j devicetypes 列出设备类型,但不幸的是分辨率没有存储在那里...
有什么想法吗?
【问题讨论】:
标签: ios command-line ios-simulator screen-resolution simctl
感谢 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
【讨论】: