ios-simulator - 如何在 Apple Watch 模拟器中测试本地通知?

标签 ios-simulator watchkit uilocalnotification apple-watch

我正在开发一个 iOS 应用程序,它将在后台显示本地通知和本地交互通知。我想测试当设备被锁定时它在配对的 Apple Watch 中的显示方式。由于我没有 Apple Watch,我如何在模拟器中进行测试?

最佳答案

如果你使用模拟器让你的 iOS 应用通知工作,然后添加一些逻辑,比如在 IBAction 5 秒后触发通知。使用 (Command ⌘ + L) 简单锁定您的 iOS 模拟器。现在通知将显示在两个设备上。

关于ios-simulator - 如何在 Apple Watch 模拟器中测试本地通知?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33429212/

相关文章:

ios - 无法在 iOS 模拟器中缩放设备窗口

ios - 启动循环中基于页面的 "reloadRootControllersWithNames:"?

ios - UILocalNotification 接收函数在 iOS10 (Swift 3.0) 中弃用

iphone - 尝试取消本地通知时应用程序抛出 'NSInvalidArgumentException'

objective-c - 无法在 iOS 的 UIWebView 中滚动

iphone - 应用程序在 iPhone 上崩溃,而不是在模拟器上崩溃

iOS 8.0 模拟器通过 HTTPS 而不是 HTTP 打开连接

iphone - NSUserDefaults 到 Apple Watch

watchkit - WKInterfaceTable 的 didSelectRowAtIndex 永远不会在 WKInterfaceController 中被调用

ios - 应用未运行时 UILocalNotification 会触发吗?