Enable Disable Watch Target in iPhone app setting Xcode - ios

Recently I have developed the watch app for my iPhone app and added the watch target in iPhone app.
I want to know is there any kind of setting by which I can choose to add/hide(enable/disable) watch target in iPhone app, like in current market release I don't want to include the watch app, so is there any setting by which I can make it disable in iPhone build but code exist in app.
Is there any kind of target/info plist or build settings by which I can achieve this.
Please suggest.
Any help would be highly appreciated.
Thanks in advance.

Go to your application target, Build Phases, Target Dependencies, and remove the WatchKit Extension from the list.

Check your Build Phases,Copy Bundle Resources in your Target,copy the watchkit app.There need no inclue watchkit app.

Related

Apple Watch App Extension won't run on the simulator anymore

I'm creating my first Apple Watch app and upon first adding the Watch and Watch extension targets I was able to start building my interface and running on the simulator. Since then I've needed to update my iOS app while still working on the Watch app. So I used this advice to "disable" my watch app so I could submit a build for the new iOS version:
Prevent deploying (disable) WatchKit App with iOS iPhone App in Xcode
Simply, by removing the watch and extension in target dependencies and embedded watch content in Build Phases did the trick. Now I'm picking back up the work I put down but can't seem to get it to run on the simulator. I add back the target dependencies and the embedded watch content but I get the error: Error Launching 'App Name Extension' Invalid Bundle - No Apple Watch Binary
Can anyone explain what that means and why I am getting this error?
For anyone who comes across this problem seeking an answer. I found that I had been changing my version and build number to accommodate my current iPhone version and build number. This was creating that error, so to fix it I left the watch app and extension app version/build as default 1.0 and 1.

target specifies product type 'com.apple.product-type.watchkit2-extension', but there's no such product type for the 'iphoneos' platform

I already have a Watch app written for iOS 8.2, I want to configure a Watch app for watch OS 2 and deliver both versions of mine Watch app inside the same iOS app. So I create a new Watch App Target for WatchOS2 with Xcode7.0, but it can not work.
How to do?
Thanks!
Make sure in build settings > under Base SDK > this is set to latest watchOS.
When you make a watch target, you need to go to Build Settings for both the Watch and the Watch Extension and change Architectures/Supported Platforms from 'iOS' to 'watchOS'.
The WatchOs2 extension should be running on the Watch Tracy, so switch it to be running on Watch in the Build Settings.

Getting black screen on Watchkit simulator and "Waiting to Attach" when adding to existing project

I'm interested in adding a Watchkit Extension to my existing app already in the app store. I've done my research, followed some tutorials, and now am ready to actually implement.
The problem I'm having is, I can't seem to add a Watchkit App to my existing project and get it to run in the simulator. If I start a new project and do some tutorials or whatever, the Watchkit App runs fine. Adding to my existing project, I just get a black screen in the simulator window. Not even the status bar is present. http://i.imgur.com/kG7H06i.png
Only lead I have so far is: In the debug navigator, I get "Waiting to Attach" every time I try and launch the app. http://i.imgur.com/vYLfJN8.png
Any help on this would be appreciated. I reseting my simulators, tried deleting my simulators and then reinstalling. Double checked that bundle identifiers and versions match. Target for the WatchKit App and Extension are both set to 8.2 (I was getting an error setting to 8.3). Target on the main app is 6.0, but I tried bumping this up to 8.2 and had the same results.
Thanks!
EDIT: Before this is marked as a duplicate of How to run a WatchKit App, I do want to mention that I'm running the "Watchkit App" Scheme, and I do not have a status bar like in the window like he does.
Are you using iOS 8.2 simulator ?
I had similar error, switching to simulator with iOS 8.3 fixed it for me.
Check that your build target is the Watchkit App. I had it set to the main app so the main app was launching in the sim, but the watch app was blank.
referenced here.
How to run a WatchKit App
I am also running into a similar problem but not on the simulator but on the Apple Watch device. Try setting Skip Install to NO in the WatchKit App target settings
After working with Apple, it appears as if this was an issue with Xcode creating the target. Our app is several years old, and for some reason when creating any new target, the Wrapper Extension is set to "app" every time. This has caused us issues in the past with trying to add testing targets as well.
We were able to fix the issue by going to the Watchkit Extension target, and changing the Wrapper Extension from "app" to "appex". Make sure you leave the Watchkit App target to "app". We asked why Xcode wasn't doing this automatically for this particular project, and it's because the overall project target has the Wrapper Extension set. If you create a new project, you'll notice that Xcode now leaves this blank.
Hope this helps someone else.
Sometimes, restarting Xcode solves the problem.
Even if everything is configured correctly, it may take 20 seconds to attach the process to the debugger.
I tried everything but nothing helped. Then I backed up the watch app and watch extension folders. After that I removed the watch app and watch extension targets and created new targets. Then I restored the files from the backup. It's an awkward approach but it solved the "waiting to attach" problem.
Xcode 10.0; Swift 4.2; iOS 12.0
I had the same issue with Apple Watch simulator. What actually solved it was deleting the default Siri watch face from the Watch App on the iPhone simulator.

Xcode / ItunesConnect: Is it possible to remove watch kit target and add it back or not submit the watchkit App?

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.

How to choose WatchKit App's parent target?

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.

Resources