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?
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.)
2) 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
The above answer is correct but if you are 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
Related
While archiving an iOS app on Xcode during the compilation phase;
I get the error -
"error: WatchKit App doesn't contain any WatchKit Extensions. Verify that the value of NSExtensionPointIdentifier in your WatchKit Extension's Info.plist is set to com.apple.watchkit." even though I have confirmed that this is set correct.
Then, why is this happening?
Thanks
Check build settings in watchappextension target if you have correct watch extension Info.plist file path. In my case, i had watch plist set.
I had similar issue. To solve that, I've modified the extension identifier so that it has watchkit's identifier as prefix. This is because, unless identifiers are prefix, those won't be allowed to embed on Xcode settings.
Check list:
In main iOS app settings on general tab, add your watchkit app in the embedded binaries section. Note that, if you ever deleted build folder, the embedded watchkit app may not be displayed in this section even if you just added there.
Make sure you see the watchkit app both in target dependancy & embedded binaries section. If not, add them on the build phases tab of your iOS app.
Now on settings of watchkit app, add your extension in the embedded binaries.
You should see the watchkit extension both in target dependancy & embedded binaries section. If not, add them on the build phases tab of your watchkit app.
On build settings of the extension, make sure bitcode is enabled. Base sdk should be latest iOS sdk.
See the watchkit app identifier is a prefix of the extension. I've renamed the product module (both for watchkit app & extension) to avoid spaces.
You should now be able to build or archive with proper mobile provisions. By the way, my Xcode version is 9.3.
Exit XCode, remove derived data, start XCode again and clean project
Ive made an iPhone app and started playing around with a watch kit app with it in the same project. However, I only want to upload the iPhone app now not the watch kit app. How do I only upload the watch kit app? I have this problem Embedded binary is not signed with the same certificate as the parent app: but I don't want to upload my watch kit app. Help
Removing watchOS Target
You should just remove the Watch Extension.
Solution:
Go to Build Phases in iOS target, which is located in your Project file, then from Target Dependencies, remove WatchKit Extension target.
Also in the same page, you should go to Embed App Extensions and remove the WatchKit extension.
Then, clean, build and run your project as usual. You should be done.
Re-adding watchOS Target
The only step is to add the extension to Target Dependencies.
NOTE: However, if you are working with watchOS 1, after adding the extension to Target Dependencies, you should add it to the Embed App Extensions too. Just select the *.appex file containing WatchKit extension data there.
Conclusion
1- To remove watchOS Target, remove it from both Target Dependencies and Embed App Extensions.
2- To re-add watchOS Target,
A) In watchOS 2, add it to Target Dependencies.
B) In watchOS 1, also add the *.appex file to Embed App Extensions as well as adding the extension to Target Dependencies.
I want to make a public release without the Watch app (which should only be released with TestFlight releases).
Here is how
Basically, you just need to take 2 steps in "Build Phases" of you main target:
Remove the WatchOS extension from "Target Dependencies"
Remove WatchOS app from "Embed Watch Content"
I suggest taking this a step further: Create a new target as a duplicate of your application's target and call it TestFlight. You can do this by right-clicking on your application target under the General tab for the project. This way you can configure your build dependencies independently from your normal AppStore release builds. Then, as ajpallares mentioned, remove the apple watch targets from your target dependencies under Build Phases.
I have a watchkit target in my project. The problem I am facing is I don't need the watchkit target to be uploaded right now. I still want to keep the code however and don't want to delete all the files. Is there a way I can submit the App without the watch kit extension App? I thought about deleting the targets (not the files), but I don't know what is the best course of action in this situation. Can I tell itunesconnect not to include the watchkit App?
If you go to the target of your main app and remove the watchkit extension from "Embedded Binaries" it should remove your watchkit app.
To expand upon the answer from Tiago, remove the Watchkit Extension from "Embedded Binaries" and "Target Dependencies."
See Prevent deploying (disable) WatchKit App with iOS iPhone App in Xcode.
I have an iOS application with several targets, which runs in a really different way on each of them. I added a watchkit app to it, but haven't found a way to specify which target of my app should be the parent. Have any of you found a way? Or is it something to ask Apple about?
You can definitely do this. You can set the target when you create the WatchKit App. Here are the steps:
Set up all your targets in your project (I believe you have this completed)
Select the + under targets and create a new WatchKit App
The next options page let's you pick from a bunch of options to set up the WatchKit App target
Under Embed in Application, choose the target you want to embed the WatchKit App in
I just confirmed this on Xcode 6.2 Beta 5.