Prevent deploying (disable) WatchKit App with iOS iPhone App in Xcode

IosXcodeWatchkit

Ios Problem Overview


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?

Ios Solutions


Solution 1 - Ios

Remove the WatchKit extension

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

  1. Remove the WatchKit extension from "Target Dependencies"
  • (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.)
  1. Remove the WatchKit extension from "Embed App Extensions" (in Xcode 7+, "Embed Watch Content")
  • (In Build Phases, go to Embed App Extensions. Remove the WatchKit extension entry from the list Embed App Extensions.)

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

To re-add the WatchKit extension:

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".

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

Remarks:

  • I have tried the whole process of removing and recreating the extension both in the simulator and on the actual devices (iPhone and Apple Watch). It worked in both cases.
  • I have also tried to do either A or B but that was not sufficient.
  • I used Xcode version 6.3.2

Solution 2 - Ios

The above answer is correct but if you are like me and not able to figure out the first point.

1) Remove the WatchKit extension from "Target Dependencies".

It means to go to your target, select build phases, then click Dependencies. remove watch dependency

NOTE Even better way is to just search 'watch' keyword in Main Target -> Build phases. The dependencies and embed watch content will be listed. Just remove them

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionGaurav SharmaView Question on Stackoverflow
Solution 1 - IosvomakoView Answer on Stackoverflow
Solution 2 - IosAmitView Answer on Stackoverflow