简体   繁体   English

运行Apple Watch的问题在模拟器中浏览应用程序

[英]Issues running Apple Watch glance app in simulator

I'm trying to test my apple watch glance for my iOS app using the simulator, however I'm getting some very strange behaviour. 我正在尝试使用模拟器测试我的苹果手表浏览我的iOS应用程序,但是我得到了一些非常奇怪的行为。 When I launch the iOS app in the simulator it works without problem and the app is fully functional. 当我在simulator启动iOS应用程序时,它可以正常工作,应用程序功能齐全。 However , when I then try to launch the glance app for apple watch afterwards it shows up, but the iOS app no longer works (if I try to launch it from the simulator it immediately crashes) and the data that's in the app sharing group doesn't show up on the watch (but if I relaunch the iOS app simulator from Xcode it shows up there). 然而,当我尝试启动苹果手表的扫视应用程序后,它显示,但iOS应用程序不再工作(如果我尝试从simulator启动它立即崩溃)和应用程序共享组中的数据不不会出现在手表上(但是如果我从Xcode重新启动iOS应用程序simulator就会出现在那里)。

I've checked both apps and they are configured for the same sharing groups and that is definitely the case. 我已经检查了这两个应用程序,并且它们是针对相同的共享组配置的,这绝对是这种情况。

I just don't understand why running the iOS app and the apple watch app in the simulator won't work / behave correctly together? 我只是不明白为什么运行iOS应用程序和simulator的Apple Watch应用程序无法正常工作/行为?

Credit to @WhiteTiger for this answer: 感谢@WhiteTiger的回答:

if you're using watchos 2 appgroup the system does not work on the device, you should use wcsession as the documentation indicates. 如果您使用的是watchos 2 appgroup系统无法在设备上运行,则应使用wcsession,如文档所示。

Or look at updating to use the WatchConnectivity approach instead 或者查看更新以使用WatchConnectivity方法

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM