为什么我的 WatchKit 扩展会导致“等待附加"?在实际的 Apple Watch 上而不是在模拟器中显示消息? [英] Why does my WatchKit extension cause a "Waiting to attach" message on an actual Apple Watch but not in a simulator?

查看:33
本文介绍了为什么我的 WatchKit 扩展会导致“等待附加"?在实际的 Apple Watch 上而不是在模拟器中显示消息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个已发布的 iOS 应用程序,并且正在尝试为它添加一个 WatchKit 扩展.

I have a published iOS app and am trying to add a WatchKit extension for it.

现在,我只有一个带有单个 label 的手表 interface.storyboard 来验证整个构建过程.该应用在模拟器(iPhone 6 (8.3))和手表模拟器上运行良好.

For now, all I have is a watch interface.storyboard with a single label just to verify the entire building process. The app runs fine on the simulator (iPhone 6 (8.3)) and the Watch simulator.

当我在 iPhone 和 Apple Watch 上运行它时,它在 iPhone 上运行,安装在 Apple Watch 上,但在尝试在 Apple Watch 上运行时只显示等待状态.

When I run it on the iPhone and Apple Watch, it runs on the iPhone, installs on the Apple Watch, but then just displays a wait status when trying to run it on the Apple Watch.

Xcode 中的错误显示 Waiting to attach",当我尝试通过 Xcode > 附加它时调试附加到进程,它说与 iPhone 的连接丢失".

The error in Xcode says "Waiting to attach", and when I try to attach it via Xcode > Debug > Attach to Process, it says "Lost connection to iPhone".

我使用的是 Xcode 6.3.1.

I am using Xcode 6.3.1.

推荐答案

Waiting to attach 消息困扰着很多人.您可以执行以下操作:

The Waiting to attach message is bothering many people. Here are a few things that you can do:

  • 首先构建主 iPhone 应用程序,然后停止并构建 WatchKit 应用程序
  • 等待附件完成(可能需要 20 秒左右)
  • 我发现点按 Apple Watch 上的应用程序图标有时有助于重新建立丢失的连接.点击应用程序图标后,应用程序通常会开始更新.因此,在消息 Waiting to attach 出现后点按您的 Apple Watch 应用.
  • 如果等待没有帮助,请停止所有进程(确保 Xcode 中的停止按钮变为灰色),然后再次构建并运行您的代码
  • 有时,重启 Xcode 有助于解决问题
  • 按照说明在 Apple Watch 上强制退出您的应用 这里
  • 如果仍然没有帮助,请使用 iPhone 上的 Apple Watch 应用程序卸载并重新安装 WatchKit 扩展程序
  • Build the main iPhone app first, then stop it and build the WatchKit app
  • Wait some time for the attachment to finish (it can take 20 seconds or so)
  • I found that tapping the app icon on the Apple Watch sometimes helps to re-establish a lost connection. After tapping the app icon, the app often starts to update. So tap on your Apple Watch app after the message Waiting to attachappears.
  • If waiting does not help, stop all processes (make sure that the stop button in Xcode becomes gray) and then build and run your code again
  • Sometimes, restarting Xcode helps to solve problems
  • Force-quit your app on the Apple Watch as explained here
  • If that still does not help, deinstall and reinstall your WatchKit extension using the Apple Watchapp on your iPhone

您可以尝试的其他事情:

Other things you could try:

  • 清理你的项目
  • 使用 iPhone 上的 Apple Watch 应用卸载并重新安装手表应用
  • 从设备中删除您的 iPhone 应用
  • 删除/重新创建目标方案
  • 在 WatchKit 应用目标设置中,将跳过安装"设置为 NO
  • Clean your project
  • Uninstall and re-install your watch app using the Apple Watchapp on your iPhone
  • Delete your iPhone app from the device
  • Delete/recreate the target scheme
  • In the WatchKit app target settings, set "Skip Install" to NO

这篇关于为什么我的 WatchKit 扩展会导致“等待附加"?在实际的 Apple Watch 上而不是在模拟器中显示消息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆