本文介绍了防止在Xcode中使用iOS iPhone App部署(禁用)WatchKit App的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我们还有一个Xcode项目,其中包含Apple Watch的构建配置。我们的Apple Watch应用尚未准备就绪,因此我们希望在禁用时发布。在构建中禁用Apple Watch功能的最佳方法是什么?

We've got an Xcode project with build configurations for the Apple Watch as well. Our Apple Watch app isn't ready yet, so we'd like to release with it disabled. What's the best way to disable Apple Watch functionality in a build?

推荐答案

删除WatchKit扩展

为了确保您的WatchKit扩展程序不再可见,您必须做两件事:

To make sure that your WatchKit extension is no longer visible, you have to do two things:

1)从Target Dependencies中删除WatchKit扩展

1) Remove the WatchKit extension from "Target Dependencies"


  • (要转到Target Dependencies:在项目导航器中,单击项目文件然后单击iPhone应用程序的目标。转到Build Phases选项卡。)

  • (To go to Target Dependencies: in the project navigator, click the project file. Then click the target of the iPhone app. Go to the Build Phases tab.)

2)删除WatchKit来自嵌入应用扩展的扩展(在Xcode 7+中,嵌入观看内容)

2) Remove the WatchKit extension from "Embed App Extensions" (in Xcode 7+, "Embed Watch Content")


  • (在构建阶段,去嵌入App Extensions。从列表嵌入App Extensions中删除WatchKit扩展条目。)

  • (In Build Phases, go to Embed App Extensions. Remove the WatchKit extension entry from the list Embed App Extensions.)

最后,你可能有清理您的构建文件夹。然后构建并运行您的iPhone应用程序。

Finally, you may have to clean your build folder. Then build and run your iPhone application.

要重新添加WatchKit扩展程序:

对于watchOS1:FIRST,将您的WatchKit扩展添加到Target Dependencies。这将重新创建 .appex 文件,您现在可以通过按加号按钮并选择应用程序名称,将其添加到Embed App Extensions下的列表中WatchKit Extension.appex。

For watchOS1: FIRST, add your WatchKit extension to Target Dependencies. This re-creates the .appex file that you can now add to the list under Embed App Extensions by pressing the plus button and choosing "App Name WatchKit Extension.appex".

对于watchOS2:只需将WatchKit扩展添加到Target Dependencies。

For watchOS2: Just add your WatchKit extension to Target Dependencies.

备注:


  • 我已尝试在模拟器和实际设备上删除和重新创建扩展的整个过程(iPhone和Apple Watch)。它适用于这两种情况。

  • 我也尝试过做A或B但这还不够。

  • 我使用的是Xcode版本6.3。 2

这篇关于防止在Xcode中使用iOS iPhone App部署(禁用)WatchKit App的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-08 14:41