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.
Related
Worked on Xcode 10. Now in the beta I can't build I keep getting this error:
a "WatchKit" is not available when building for iOS Simulator.
Consider using #if !os(iOS) to conditionally import this framework.
I had the same issue for one swift file in the WatchKit Extension. It turned out that it was a member of both the iOS app and the WatchKit Extension. I unticked the iOS app in the target membership section for the file so that it only belongs to the WatchKit Extension target. Now the project builds successfully.
Some of the functionality to communicate between the Apple watch with the iPhone/iPad used to be implemented within the WatchKit framework. But at some point it got moved into the WatchKitConnectivity framework.
If you look in your Target's "Build Phase" -> "Link Binary With Libraries" section, you will see the "WatchKit.framework" with "Optional" status. iOS13+ has become more "strict" so it won't build unless I completely remove the "WatchKit.framework", and instead add "WatchConnectivity.framework".
Also make sure your iPhone/iPad code refers use "import WatchConnectivity" instead of "import WatchKit".
We need to use "Conditional Imports" to resolve the issue.
Replace the import WatchKit header with the below code :
#if !os(iOS)
import WatchKit
#endif
This resolved my issue and build successfully in iOS 13.
Xcode 11 removes WatchKit from the iOS SDK. From release notes:
The WatchKit framework is no longer included in the iOS SDK. If you’re using WatchKit APIs from iOS, you need to remove this use. The WatchKit framework remains available on watchOS. If you’re using WatchKit APIs from iOS to infer availability of features on the paired Apple Watch, include information about your use case when you submit feedback to Feedback Assistant. (49707950)
This includes Cordova plugins that reference WatchKit in plugin.xml:
<framework src="WatchKit.framework" />
The above line will add WatchKit as a framework for the iOS app target. You'll need to remove this and add WatchKit only to Watch target of your app.
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
I have a universal iOS app which runs on all iOS 9 capable iPhone and iPads. The app also has a Watch extension. When I come to submit the first version to the App Store, which target do I build, archive and submit? Do I have to archive the Watch extension target, or will the Watch extension be included if I build, archive and submit the iOS app target? Or does it not matter?
Apple documentation states the following:
Adding a Watch app target to your Xcode project creates two new
executables and updates your project’s build dependencies.
Furthermore, regarding building of the app:
Building your iOS app builds all three executables (the iOS app,
Watch app, and WatchKit extension) and packages them together inside
the iOS app’s bundle.
(emphasis mine)
The iOS app target. Extension and watch app would be bundled within the original package, automatically.
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
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.