watchOS is the operating system for Apple Watch.

watchOS Documentation

Posts under watchOS tag

421 Posts
Sort by:
Post not yet marked as solved
5 Replies
1.2k Views
Got a little app I am trying to build before launch, I've never built a watch only app, and it requires iOS 17 so I'm a bit stuck. When creating a watch only target, it seems that the template is broken. According to this: https://developer.apple.com/documentation/watchos-apps/creating-independent-watchos-apps/ There should be a blank iOS app target, that contains the watch app. The problem is once I go to build and upload the app to test flight, I get a bundle that Xcode has no clue what to do with (Because it only contains the watchkit app, and no containing xcode app.) I'm guessing my only hope might be to create a watch only app targetted at iOS 9 with Xcode 14, then migrating to Xcode 15? I'm trying that now, but I guess I have another radar to file unless I'm missing something.
Posted
by jclardy.
Last updated
.
Post not yet marked as solved
0 Replies
185 Views
Hi all, I am trying to build an app which, on support Apple Watch's (currently just the Ultra's), will detect when the watch has been submerged and will start to report temperature from the sensor. I have followed the developer articles I could find around CMWaterSubmersionManager and have set up a simple class to interact with it. It is now that I want to run my app and test if it is working as I expect it to etc. However I noticed that the waterSubmersionAvailable is only set to true on physical Apple Watch Ultra and Ultra 2. This is rather inconvenient as it means that for the next week or so while developing this feature I will have to stick my arm wearing the watch into a container of water to test the feature. Just wondering if there is any easier way to debug this stuff that anyone has figured out? It would be ideal if this could just be done in the simulator similar to how other device conditions can be induced. I did notice the "Enable Easy Submersion" option in the Debug menu, however I could not figure out a difference between having this on or off, and could not find any explanation of what it actually does on the docs. Does anyone have any experience with this either? Any advice would be appreciated, and to any Apple engineers who may see this, please please please add an option to be able to debug this stuff in the Simulator
Posted
by devharry.
Last updated
.
Post not yet marked as solved
0 Replies
229 Views
Is there a way to migrate WidgetKit extensions made using dual-target watchOS apps to single-target apps? When you create a widget extension with a dual-target app, the bundle identifier includes the extra extension domain (com.company.app.watchkitapp.watchkitextension.widgets). When Xcode 15 migrates a dual-target to single-target, it removes “.watchkitextension” from both the watchOS app bundle identifier and the widget extension bundle identifier. watchOS seems to handle migrating the main app just fine, but any complications created with the dual-target do not get migrated and are just blank until the user re-configures, which would be a huge bummer to have to ship. If I try to manually set the bundle identifier back to include “.watchkitextension”, the OS rejects the installation because of the extraneous dot after the parent app’s prefix.
Posted
by bbatsell.
Last updated
.
Post not yet marked as solved
1 Replies
220 Views
Hello I have been using apple products for quite some time now and am also updating my phone with latest beta software updates for watch, airpods 2 etc. Recently, I have started facing an irritating issue - I am unable to control the volume via my apple watch crown for music playing on youtube music / spotify etc. Earlier while operating the watch crown, I could lower/increase the volume of the music/videos on the "Now Playing" screen on the watch. But with recent updates its not happening. Please advise. TIA! Software versions: iphone - ios 17.4 apple watch 8 - watchOS 10.4
Posted Last updated
.
Post not yet marked as solved
0 Replies
161 Views
I am currently developing app that counts the Steps, and for that I am using the pedometer. I am not sure of how frequent pedometer provides updates, in my case it provides update around 3 second. There is nothing mentioned about frequency of Data in Official documentation of Apple or Any ways to set the Frequency. Application is in Both iOS and WatchOS plateform To achieve data i have tried following things: With startUpdates(from: Date) pedometer.startUpdates(from: Date()) { [weak self] pedometerData, error in guard let data = pedometerData, error == nil else { return } DispatchQueue.main.async { self?.stepCount = data.numberOfSteps.intValue } } With queryPedometerData() timer = Timer.scheduledTimer(withTimeInterval: 1.0, repeats: true) { [weak self] _ in self?.fetchPedometerData() } private func fetchPedometerData() { pedometer.queryPedometerData(from: Date().addingTimeInterval(-1), to: Date()) { [weak self] pedometerData, error in guard let data = pedometerData, error == nil else { return } DispatchQueue.main.async { self?.stepCount = data.numberOfSteps.intValue } } } I have done this both implementation but Not getting desired results. I want data every second, Could it be possible ? Any help or leads would really helpful Thank You :)
Posted Last updated
.
Post not yet marked as solved
0 Replies
154 Views
Hello, For several months now, my watch app will not automatically install when I install local builds from Xcode. If I download our app from the app store, the watch app automatically installs immediately after the phone app (and automatic app install is set to ON in my Apple Watch Settings). But if I install a build from Xcode, I have to manually install the watch app after installing the phone app. How do I get it to go back to the previous behavior where, after I install the phone app, the watch app just automatically installs? It used to do this automatically for me, but no longer does. I want to say this behavior started when I installed the Xcode beta late last year but the behavior has continued on the newest version of Xcode.
Posted
by bryany.
Last updated
.
Post marked as solved
9 Replies
3k Views
Right, this is getting on my nerves now. iOS app installed on iPhone via Xcode. Watch app installed on Watch via Xcode. Both apps are running and are in the foreground. iOS app launches on iPhone and reports: WCSession.isSupported = YES theDelegate.session.isPaired = YES theDelegate.session.watchAppInstalled = NO theDelegate.session.activationState = Activated I press a button in the Watch app. It reports: session == activated and reachable iOS app delegate receives a message from the Watch app: didReceiveMessage (from Watch): message = {     action = giveMeUpdatedItems; } The apps must be installed on the devices in order for the Watch app to have used sendMessage (which is only available if the session is reachable, which it is). iOS app delegate passes that through as a notification to another bit of code that collates the info and sends it back to the Watch app. watchNotificationUpdateData; userInfo = {     action = giveMeUpdatedItems; } That bit of code in the iOS app checks whether we can send data to the Watch app, and doesn't send the data because: WCSession.isSupported = YES theDelegate.session.isPaired = YES theDelegate.session.watchAppInstalled = NO theDelegate.session.activationState = Activated If I remove the check for watchAppInstalled, I get this: Error sending Watch application context: Watch app is not installed. {     NSLocalizedDescription = "Watch app is not installed.";     NSLocalizedRecoverySuggestion = "Install the Watch app."; } I've deleted and reinstalled the app on both devices countless times. I've rebooted the devices, plus the Mac. I've reinstalled Xcode. I've cleaned builds. I've deleted DerivedData. And still it says the companion app isn't installed.
Posted
by darkpaw.
Last updated
.
Post not yet marked as solved
5 Replies
667 Views
I have a Watch companion app. The SwiftUI previews fail to build for the watch app. The errors indicate it is trying to build Swift package targets that are meant for iOS only, not the watch. The watch does not include these dependencies so it is perplexing it will try to build them. Digging into the scheme for the watch app, it includes the iOS target as you can see the screenshot. This seems to be the default when you create a new watch target. If I uncheck the boxes for the iOS target, previews will build fine. But I think this means that each time I build my Watch target, it will not simultaneously build my iOS target. I'm not sure of the impact of that. Is this a known limitation with Previews? Is there another workaround?
Posted Last updated
.
Post marked as solved
1 Replies
171 Views
I have had issue with sleep focus on my watch 8 since late in the iOS 16/ WatchOS 9 betas. I opened a feedback in Oct 2023 when 10.1 betas. When sleep focus is on the watch shows it's active and did not alert but it still works like normal. It used to go dark and I could tap the screen to see the time and press the crown to exit from that mode to use it. I wish this would be fixed. I'm tried of having to use theater mode with I go do bed. The light of the watch is
Posted Last updated
.
Post not yet marked as solved
0 Replies
278 Views
I'm using NavigationLink(value:label:) and .navigationDestination(for:destination:) in my SwiftUI watchOS app. However navigating in the app causes the system to emit the following errors to the console: <NavigationHostingControllerCache>: MISS at depth 1 in free stack [NavigationHostingControllerCache_UIKit] <_TtGC7SwiftUI32NavigationStackHostingControllerVS_7AnyView_: 0x125015000> containment skipped because sourceNavigationController or destination were nil or sourceNavigationController was equal to destination [NavigationHostingControllerCache_UIKit] Eject called for index: depth 1 in free stack Library: SwiftUI, Subsystem: com.apple.SwiftUI , Category: Invalid Configuration The navigation itself does work fine. I'm wondering there's something I can do to fix it or if this is an internal issue of the SwiftUI framework and cannot be addressed by me? (i.e. I can ignore this)
Posted Last updated
.
Post marked as solved
2 Replies
694 Views
Hi everyone, We're fighting an issue that's driving us up the wall. We developed an Apple Watch Only standalone app, which cost $2.99; once you paid, you could download and use the app on your Apple Watch. We've released a companion iOS app for iPhone that goes into the same bundle (as it's the same app, now supporting two platforms). Nevertheless, the Watch app is still available as a separate app (you can download the Watch app only if you wish without needing to download the iPhone app as well). The iOS companion reads information from the watch and provides more insights into the data it displays. Similar to the sleep tracking apps where you use the watch to sleep and track and the iPhone to see the results. When we released the latest version, including both, we changed the price to Free in all countries. After this, we now have a huge problem we haven't been able to solve: Our existing users (who paid for the Apple Watch-only app) cannot download the companion iOS app. If they go to the App Store, it'd just say "Purchased" with no option to download it (nor the "Get" button or the "Cloud" icon). If you go to your App Store account in your iPhone and then to "Purchases," the app won't appear there. Because technically, you never bought it, and it's now free. If you do the same on your Apple Watch, you can still see the app on your purchases, but that would only download the Apple Watch app, not both. But on top of that, I want my users to be able to download the companion app from the App Store with their iPhones because that's what they'll do anyway (only 9% of our app downloads happen straight in an Apple Watch; most come from iPhones). Did anyone have this problem? I'm already talking with support because this is having a very negative impact on our app, and it all looks to be a bug on the App Store or an edge case that Apple hasn't considered. The thing is, I experienced this issue myself with an app from another dev previously where I had the Apple Watch app installed and paid for it. When I wanted to download the companion they released, it was impossible for the same reasons stated above. He managed to fix it, but I couldn't find any information.
Posted
by Ataliano.
Last updated
.
Post not yet marked as solved
0 Replies
219 Views
I'm trying to execute a background task following the Developer Documentation. This is my code import SwiftUI @main struct MyAppTest_Watch_AppApp: App { @Environment(\.scenePhase) var scenePhase let bs = BackgroundSession() @SceneBuilder var body: some Scene { WindowGroup { ContentView() }.backgroundTask(.appRefresh("prova")) { context in print("bg task") await scheduleTask() } .onChange(of: scenePhase) { phase in switch phase { case .active: print("\(#function) REPORTS - App change of scenePhase to ACTIVE") case .inactive: print("\(#function) REPORTS - App change of scenePhase Inactive") case .background: print("\(#function) REPORTS - App change of scenePhase Background") WKApplication.shared() .scheduleBackgroundRefresh( withPreferredDate: Date.init(timeIntervalSinceNow: 5 * 60.0), userInfo: "prova" as NSSecureCoding & NSObjectProtocol, scheduledCompletion: schedule) default: print("\(#function) REPORTS - App change of scenePhase Default") } } } func scheduleTask() async { bs.testSession() await WKApplication.shared() .scheduleBackgroundRefresh( withPreferredDate: Date.init(timeIntervalSinceNow: 5 * 60.0), userInfo: "prova" as NSSecureCoding & NSObjectProtocol, scheduledCompletion: schedule) } func schedule(error: Error?) { if error != nil { // Handle the scheduling error. fatalError("*** An error occurred while scheduling the background refresh task. ***") } print("Scheduled!") } } On the simulator the background refresh occurs correctly according to the preferred date and executes the background task, on the real watch it does not. I also set the app as complication in my watch face. The device I'm testing the app on is an Apple Watch Serie 7 with watchOS 10.3. Any idea?
Posted Last updated
.
Post not yet marked as solved
0 Replies
212 Views
I'm trying to develop a watchOS app with location. I've got the proper privacy settings in the info.plist, similar code works on other devices. (also simulators). But on watchOS simulators everything is grayed out. Privacy & Location -> Location Services App shows up correctly, but everything is grayed out. I've tried: Different simulators (with/without paired iPhone) Different app configurations (Watch-Only app, Watch App with new companion) Toggling Supports Running Without iOS App Installation. It's always grayed out! This is with watchOS 10 simulators across any model, and Xcode 15.2 Any help would be appreciated.
Posted Last updated
.
Post not yet marked as solved
1 Replies
248 Views
I am trying to build my watch app on my series 4 Apple watch currently running WatchOS 10.3 with a deployment target of 10.2 and Xcodes claims that my watch's OS version is too low. I have fully updated my watch to 10.3, tried to downgrade the deployment target to no avail. Xcode doesn't seem to be getting any data on what OS version my watch is running. It says watchOS () in the manage run destinations page. I imagine this is a problem with the connection between my watch and my mac but I cannot solve it. Any advice?
Posted
by Alec a.
Last updated
.
Post not yet marked as solved
2 Replies
422 Views
⌚️Hello, I've noticed in watchOS 10 that when a complication is in the Smart Stack, the value of WCSession.isComplicationEnabled is false. I'm not sure if this is intentional or a bug. It seems trivial at first glance, but it actually affects the communication mechanism mentioned in Implementing Two-Way Communication Using Watch Connectivity. In the following two scenarios, if the user has only added the app's complication to the Smart Stack, then the watch app will not be able to communicate properly with the iOS app. Scenario 1 - WCSession.transferCurrentComplicationUserInfo() // update complications from the iOS app if WCSession.default.isComplicationEnabled { let userInfoTransfer = WCSession.default.transferCurrentComplicationUserInfo(userInfo) // ... } As described in Implementing Two-Way Communication Using Watch Connectivity, when the iOS app proactively updates the data of the watch app, since WCSession.isComplicationEnabled is false, WCSession will refuse to transfer any data. This causes the standalone complication in Smart Stack to not be updated. Scenario 2 - WKApplicationRefreshBackgroundTask When the watch app uses WKApplication.scheduleBackgroundRefresh() to periodically update data, as long as the user has added the app's complication to the watch face, the corresponding WKApplicationRefreshBackgroundTask can be executed periodically in the background to fetch data. However, if the user has only added complication to the Smart Stack, then the watch app will be completely purged, and the background task will not be executed at all. Although WCSession.isComplicationEnabled is not directly used in this scenario, its behavior appears to be the same, that is, the complication in the Smart Stack is not considered a complication by the system. Should I submit a bug report?
Posted
by Gong.
Last updated
.
Post not yet marked as solved
1 Replies
319 Views
My watch APP needs to keep Bluetooth connected with peripherals whether it is in the foreground or background, but the results of my test show that the connection in the background is very unstable, sometimes you can keep the Bluetooth on for a day, but sometimes it will be disconnected 50 times a day, and every time it is disconnected, I will immediately initiate a reconnection, it is certain that there is no problem with the peripheral Bluetooth, because I have another iOS device that has been stably connected to the peripheral, I want to know what causes this instability, and if there is any solution, if someone can provide relevant advice, I will be very grateful
Posted Last updated
.
Post not yet marked as solved
0 Replies
296 Views
I am experiencing difficulties in fully integrating my Apple Watch with a supervised iPhone under MDM control. While I have successfully paired the watch with the iPhone, I am facing issues with some apps not syncing or appearing on the Apple Watch. This issue persists despite having allowed their bundle IDs in the MDM’s whitelist. Could anyone provide guidance on which specific Apple bundle ID is crucial for maintaining the connectivity and functionality between the iPhone and the Apple Watch? Understanding this would help in ensuring that the necessary bundle ID is whitelisted in the MDM settings, thus resolving the app visibility and functionality issues on the Apple Watch.
Posted
by isach.
Last updated
.
Post not yet marked as solved
1 Replies
279 Views
The following WatchOs App example is very short, but already not functioning as it is expected, when using Digital Crown (full code): import SwiftUI struct ContentView: View { let array = ["One","Two","Three","Four"] @State var selection = "One" var body: some View { Picker("Array", selection: $selection) { ForEach(array, id: \.self) { Text($0) } } } } The following 2 errors are thrown, when using Digital Crown for scrolling: ScrollView contentOffset binding has been read; this will cause grossly inefficient view performance as the ScrollView's content will be updated whenever its contentOffset changes. Read the contentOffset binding in a view that is not parented between the creator of the binding and the ScrollView to avoid this. Error: Error Domain=NSOSStatusErrorDomain Code=-536870187 "(null)" Any help appreciated. Thanks a lot.
Posted
by Duckjd.
Last updated
.
Post not yet marked as solved
0 Replies
210 Views
Hi everyone, When we launched our WatchOS app and the iPhone companion app, we had the option "app can run independently of companion iphone" enabled. The problem we have is that many of our users don't know that there is an iOS app because the app runs independently. We would like to change it so that, if the user has enabled the automatic download of both versions, in the next update the iOS version will be downloaded as well, so that the user will see it. However, we have read that if "app can run independently of companion iphone" is enabled, it cannot be reverted in future builds. Is this correct? Another possible solution that we think might work is to display a message on first boot to inform users that we also have an iOS app, the problem is that our users usually see the message when they don't have the phone at hand (because of the nature of the app) and I don't know if a trigger can be made to install the iPhone app from the watch (or at least open the App Store). Any suggestions or ideas?
Posted
by Ataliano.
Last updated
.