【问题标题】:Overriding status bar display time for Apple Watch simulator (using xcrun simctl status_bar)覆盖 Apple Watch 模拟器的状态栏显示时间(使用 xcrun simctl status_bar)
【发布时间】:2020-06-10 00:08:32
【问题描述】:

我需要覆盖 Apple Watch 模拟器的状态栏显示时间,以便我可以截取时间 - 10:09。我在终端中使用此命令来执行此操作,但它没有按预期工作。不过,该命令适用于 iOS 模拟器。

xcrun simctl status_bar "Apple Watch Series 5 - 44mm" override --time "10:09"

我确实有一个同名的模拟器(Apple Watch Series 5 - 44mm)正在运行。

如何覆盖 Apple Watch 模拟器的时间?

模拟器版本:11.3.1版(SimulatorApp-912.5.1 SimulatorKit-570.3 CoreSimulator-681.17.2)

【问题讨论】:

  • 目前这个cmd好像不支持Apple Watch。
  • @Kjuly 有官方参考资料提到吗?
  • 只是没提,我记得这是几个月前推出的新cmd。你可以试试xcrun simctl status_bar "Apple Watch Series 5 - 44mm" list看看当前的设置,结果你会看到,即使xcrun simctl status_bar "Apple Watch Series 5 - 44mm" override --time "10:09"设置的时间成功了,模拟器也不会更新时间标签。无论如何,希望它在未来支持。

标签: watchkit apple-watch simulator watchos watchos-6


【解决方案1】:

我在使用 Xcode 13.2 时遇到了同样的问题。当我运行命令时,我收到以下错误消息:

An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=1):
Status bar overrides not supported on this platform.
Operation not permitted

例如,我发现的唯一解决方法是将我的 macOS 时间手动设置为 9:40。然后,我关闭模拟器并再次启动它,以便更新新时间。在您的 watchOS 应用完成加载后,您有大约一分钟的时间来截取必要的屏幕截图。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-02-10
    • 1970-01-01
    • 1970-01-01
    • 2016-06-19
    • 1970-01-01
    • 2015-05-11
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多