Xcode Watchkit 在编辑方案中没有可执行文件

Xcode Watchkit no executables in Edit Scheme

我正在尝试在 Xcode 中为 Watchkit 应用程序创建不同的方案 - 一种用于通知,一种用于 Glance。

当我复制 Watchkit 方案,然后转到 "Edit scheme",更改 运行 选项卡中的可执行文件时,那里只有主要可执行文件,而不是我刚刚复制的那个.

我什么都试过了。

有什么想法吗?

您有 select watchkitInterface,您会在其中看到静态、动态通知和概览。

Xcode 方案管理 构建目标 。 Apple Watch Notifications 和 Glances 没有创建为单独的目标。

它们是在您的 WatchKit 应用程序中的 Storyboard 上使用 Glance Interface Controller 和 Notification Interface Controller 对象设计的,并在您的 WatchKit App Extension(以及可能在其他地方,用于通知源)中的代码中得到支持。

因此,它们无法通过构建方案进行管理。可能有助于回顾您尝试通过此操作在功能上实现的目标。可能有另一种方法来实现它。例如,如果您只想拥有一个 Glance 或 Notification 界面而没有 WatchKit 应用程序,您只需在 WatchKit 应用程序中创建一个 Storyboard,它只包含 Glance and/or 通知界面控制器,而不是标准的 WKInterfaceController。 Apple Watch 会完成剩下的工作。

在最新的 Xcode Beta 6.2 WatchKit 中自动创建 Glance 和 Notification 的 Schemes。

在“编辑方案”Window 中,单击左侧面板中的 运行 图标。接下来,查看右侧面板和显示 "Watch Interface" 的位置,单击单词 "Main" 并更改为适当的选项。