watchOS is the operating system for Apple Watch.

watchOS Documentation

Posts under watchOS tag

412 Posts
Sort by:
Post not yet marked as solved
1 Replies
114 Views
Hi, it seems like the wachOS sysdiagnose debug profile is no longer valid and needs to be updated. Any idea to whom we should reach out to get this fixed? I am talking about the profile linked here: https://developer.apple.com/bug-reporting/profiles-and-logs/?platform=watchos Kind regards Alex
Posted
by AlexSFD.
Last updated
.
Post not yet marked as solved
1 Replies
433 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 not yet marked as solved
3 Replies
948 Views
With the new interactive widgets brought by iOS 17, is it possible to indicate that an action (button tap or toggle use) has been triggered by firing an Haptic feedback to the user?
Posted
by Clem23.
Last updated
.
Post not yet marked as solved
0 Replies
56 Views
I noticied that my workout session is sometimes being killed by apple when the app is in the background and it seems that the func workoutSession(_ workoutSession: HKWorkoutSession, didChangeTo toState: HKWorkoutSessionState, from fromState: HKWorkoutSessionState, date: Date) { is only being called when the app comes back into the foreground. I wonder if there is a way for us to get notified when the workout is about to die or has already been killed. Thanks
Posted Last updated
.
Post not yet marked as solved
27 Replies
7.6k Views
None of my existing apps (both in-AppStore and in-development) nor even a brand new WatchOS app can be installed to my Apple Watch. While using Xcode to build and deploy to my Watch, I get this: ”Waiting to reconnect to Apple Watch Xcode will continue when the operation completes.” However, this dialog persists and never completes. I’m running all of the latest: MacOS 14 beta 4, Xcode 15 beta 5, Watch OS 10 beta 4, iOS 17 beta 4. I’ve tried resetting my Watch (with “Erase All” option) and restarting the Mac, the phone and the watch. Any help?
Posted
by CryptoKoa.
Last updated
.
Post not yet marked as solved
1 Replies
1.9k Views
I recently raised this post explaining how I couldn't seem to get watchOS 9 complications to work, and I've figured out a partial fix. The original post details the issues with complications - and some are still valid - but this fix applies to both my complications and Home Screen / Lock Screen widgets. I was following the various WWDC 2020/2022 videos and the Emoji Rangers sample code, adding bits here and there, and assuming they were completely valid. Sadly, this bit of code in the widget's dynamic intents IntentTimelineProvider getTimeline really just banjaxed everything: // Create entries for one day, 15 minutes apart let currentDate = Date() for minuteOffset in stride(from: 0, to: 60 * 60 * 24, by: 15) { let entryDate = Calendar.current.date(byAdding: .minute, value: minuteOffset, to: currentDate)! entries.append(EventEntry(date: entryDate, event: event)) } If I remove that, and generate a different timeline with specific dates and times (for example: now, in 10 mins, in 2 hours, in a day, etc.) the complications appear correctly, as do Home Screen and Lock Screen widgets. The outstanding issues with complications are: The previews all use the same data, but getSnapshot() is supposed to return the data specific to that event from the configuration, i.e. if let theId = configuration.event?.identifier. "Christmas" is correct, but "Gallery Opening" is using Christmas's data. Once I've selected the event I want to use in a complication the edit screen shows it as totally blank, not even a placeholder: I hope this little fix works for you guys. And, if you know how to fix the above issues, let me know. (iOS 16.1 beta 1, Xcode 14.1 beta 1)
Posted
by darkpaw.
Last updated
.
Post not yet marked as solved
12 Replies
1.6k Views
I got a new MacBook and set it up as a new one, not transferring any data from the old one. But now the Apple Watch (Series 6) paired with my iPhone (14 Pro Max) ist not shown in Xcode. iPhone and Watch are using the latest RC and also Xcode is the latest RC. But in Xcode I ca only see my iPhone, not the paired Watch. See Screenshots. The first shows the new MacBook and the second the old one. I already tried a lot, but nothing helps: Unpair Watch from Phone and then pair it again Plug the iPhone to different USB ports Restart Watch, iPhone and Mac Delete the iPhone from Xcode Enable and disable Developer Mode on iPhone and Watch What else can I try to get the Watch back?
Posted
by Urkman.
Last updated
.
Post not yet marked as solved
2 Replies
174 Views
Hi, I have a watchOS app that records audio for an extended period of time and because the mic is active, continues to record in background mode when the watch face is off. However, when a call comes in or Siri is activated, recording stops because of an audio interruption. Here is my code for setting up the session: private func setupAudioSession() { let audioSession = AVAudioSession.sharedInstance() do { try audioSession.setCategory(.playAndRecord, mode: .default, options: [.overrideMutedMicrophoneInterruption]) try audioSession.setActive(true, options: .notifyOthersOnDeactivation) } catch { print("Audio Session error: \(error)") } } Before this I register an interruption handler that holds a reference to my AudioEngine (which I start and stop each time recording is activated by the user): _audioInterruptionHandler = AudioInterruptionHandler(audioEngine: _audioEngine) And here is how this class implements recovery: fileprivate class AudioInterruptionHandler { private let _audioEngine: AVAudioEngine public init(audioEngine: AVAudioEngine) { _audioEngine = audioEngine // Listen to interrupt notifications NotificationCenter.default.addObserver(self, selector: #selector(handleAudioInterruption(notification:)), name: AVAudioSession.interruptionNotification, object: nil) } @objc private func handleAudioInterruption(notification: Notification) { guard let userInfo = notification.userInfo, let interruptionTypeRawValue = userInfo[AVAudioSessionInterruptionTypeKey] as? UInt, let interruptionType = AVAudioSession.InterruptionType(rawValue: interruptionTypeRawValue) else { return } switch interruptionType { case .began: print("[AudioInterruptionHandler] Interruption began") case .ended: print("[AudioInterruptionHandler] Interruption ended") print("Interruption ended") do { try AVAudioSession.sharedInstance().setActive(true) } catch { print("[AudioInterruptionHandler] Error resuming audio session: \(error.localizedDescription)") } default: print("[AudioInterruptionHandler] Unknown interruption: \(interruptionType.rawValue)") } } } Unfortunately, it fails with: Error resuming audio session: Session activation failed Is this even possible to do on watchOS? This code worked for me on iOS. Thank you, -- B.
Posted
by trzy.
Last updated
.
Post not yet marked as solved
17 Replies
1.7k Views
Hello, The Apple Watch's connectivity to Xcode has always been finicky. Sometimes it would start doing "transport errors" and you'd have to repair the watch/phone to xcode to resolve it. Now after the 10.4 upgrade, it seems that there are cases where the watch doesn't even show in the device list. Here's what I've observed: The watch will connect the first time you launch xcode(after 10.4 install or a new restore). If you unpair the watch, it will never show in the device list again. This is despite any remediation efforts, such as unpairing the phone from xcode, restarting the watch/phone, and clearing trusted devices. Erasing the watch and restoring it will allow it to connect again to xcode, but only if you never unpair it. If you unpair the watch, it will repeat the behavior of not showing in the device list again. So, the only solution is to erase/restore the watch to get it to show in the device list on xcode. Every single time. Again, this is new behavior for Watch OS 10.4
Posted Last updated
.
Post not yet marked as solved
3 Replies
451 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
2 Replies
218 Views
Good morning, I come to you for a question: When I install my application on my iPhone for the first time, and I install the watch application from the native "Watch" application, the Watch Connectivity function does not work, I have to do the installation from Xcode to the watch for this function to work. Is this normal? if yes, the problem will not arise during a publication? I have the same problem when using watch and iPhone simulators, WatchConnectivity does not work. I am this error code in Xcode: -[WCSession handleIncomingUserInfoWithPairingID:]_block_invoke delegate (null) does not implement session:didReceiveUserInfo:, discarding incoming content Here is the code for the iPhone and the watch: In my iPhone app: import WatchConnectivity let userDefaultsDataVenantWatch = UserDefaults.standard class PhoneDataModel : NSObject, WCSessionDelegate, ObservableObject { static let shared = PhoneDataModel() let session = WCSession.default @Published var TableauSynchroIphoneVersWatch : [String:String] = ["0":"0"] @Published var dataWatchVersIphone: [String:String] = ["":""] override init() { super.init() if WCSession.isSupported() { session.delegate = self session.activate() } else { print("ERROR: Watch session not supported") } } func session(_ session: WCSession, activationDidCompleteWith activationState: WCSessionActivationState, error: Error?) { if let error = error { print("session activation failed with error: \(error.localizedDescription)") return } } func sessionDidBecomeInactive(_ session: WCSession) { session.activate() } func sessionDidDeactivate(_ session: WCSession) { session.activate() } func session(_ session: WCSession, didReceiveUserInfo userInfo: [String : Any]) { guard let newCount = userInfo["TableauSynchroIphoneWatch"] as? [String:String] else { print("ERROR: unknown data received from Watch TableauSynchroIphoneWatch") return } DispatchQueue.main.async { print(newCount) } } } In my Watch app: import WatchConnectivity let userDefaultsDataVenantIphone = UserDefaults.standard var TableauVenantIphone:[String:String] = ["":""] class WatchDataModel : NSObject, WCSessionDelegate, ObservableObject { static let shared = WatchDataModel() let session = WCSession.default @Published var TableauSynchroIphoneWatch : [String:String] = ["0":"0"] override init() { super.init() if WCSession.isSupported() { session.delegate = self session.activate() } else { print("ERROR: Watch session not supported") } } func session(_ session: WCSession, activationDidCompleteWith activationState: WCSessionActivationState, error: Error?) { if let error = error { print("session activation failed with error: \(error.localizedDescription)") return } } func session(_ session: WCSession, didReceiveUserInfo userInfo: [String : Any]) { guard let newCount = userInfo["TableauSynchroIphoneVersWatch"] as? [String:String] else { print("ERROR: unknown data received from Watch TableauSynchroIphoneWatch") return } DispatchQueue.main.async { print(newCount) } } } Thank for your answers !
Posted
by MaximeHae.
Last updated
.
Post not yet marked as solved
0 Replies
149 Views
I'm building complications using WidgetKit and SwiftUI. The complications work, but the previews don't appear right away when applying the .watchface. How can I ensure the complication previews show up immediately when a user adds the watch face? Any guidance is appreciated.
Posted Last updated
.
Post not yet marked as solved
4 Replies
360 Views
XCode 15.3, watchOS 10.4 SDK Our health-related app is exploring adding an additional feature that would make use of extended runtime sessions to guide users through an activity. A user starts a session by tapping a button on the watchOS app's interface. If a session is already running, pressing that button should cause the current session to invalidate, and a new session should be created so we can start again from the beginning. TLDR: Running new sessions works as expected on the simulator but not on a real device. Why? We currently have a barebones implementation that includes logging in the extended runtime session delegate functions, on the button push, and when the new session is about to start. Here's what our logging output for the simulator looks like when we try to invalidate the current session and run another one: Invalidating extended session Optional("<WKExtendedRuntimeSession: 0x60000262d7a0> state=2, sessionID=4894EB1D-96F7-4921-8263-378E304E719F, expirationDate=2024-03-20 13:01:10 +0000") at 12:01:21 PM Extended runtime session <WKExtendedRuntimeSession: 0x60000262d7a0> state=3, sessionID=4894EB1D-96F7-4921-8263-378E304E719F, expirationDate=2024-03-20 13:01:10 +0000 invalidated for reason WKExtendedRuntimeSessionInvalidationReason(rawValue: 0) with error nil at 12:01:21 PM Requesting new extended session in application state 0 at 12:01:22 PM Starting new extended session Optional("<WKExtendedRuntimeSession: 0x600002644540> state=0, sessionID=B34ECCFF-A0DA-45C1-9FD1-FD0F335FBE02, expirationDate=(null)") in application state 0 at 12:01:23 PM Did start extended session <WKExtendedRuntimeSession: 0x600002644540> state=2, sessionID=B34ECCFF-A0DA-45C1-9FD1-FD0F335FBE02, expirationDate=2024-03-20 13:01:23 +0000 at 12:01:23 PM As you can see, we successfully invalidate a running session, a button press requests a new one, and then we create and start a new runtime session instance which ends in the running (2) state. We can repeat this over and over without issue. The exact same code running on an actual device produces this: Invalidating extended session Optional(\"<WKExtendedRuntimeSession: 0x15db5750> state=2, sessionID=889FE2E8-0FDA-4826-9094-4D48094FEBED, expirationDate=2024-03-20 12:53:55 +0000\") at 11:56:04AM Extended runtime session <WKExtendedRuntimeSession: 0x15db5750> state=3, sessionID=889FE2E8-0FDA-4826-9094-4D48094FEBED, expirationDate=2024-03-20 12:53:55 +0000 invalidated for reason WKExtendedRuntimeSessionInvalidationReason(rawValue: 0) with error nil at 11:56:04AM Requesting new extended session in application state 0 at 11:56:05AM Starting new extended session Optional(\"<WKExtendedRuntimeSession: 0x15e0aba0> state=0, sessionID=D5020337-D20B-48BE-B2EE-EE44BE580AEC, expirationDate=(null)\") in application state 0 at 11:56:06AM Extended runtime session <WKExtendedRuntimeSession: 0x15e0aba0> state=3, sessionID=D5020337-D20B-48BE-B2EE-EE44BE580AEC, expirationDate=(null) invalidated for reason WKExtendedRuntimeSessionInvalidationReason(rawValue: 1) with error nil at 11:56:06AM The difference is in the last line: starting the session was unsuccessful and it was immediately invalidated, with the reason WKExtendedRuntimeSessionInvalidationReason(rawValue: 1) which maps to the enum sessionInProgress. This is surprising, since we just invalidated and dereferenced the old runtime session. What else can we do to tear down this session? In fact, no other extended runtime sessions can be created and started successfully until the device is rebooted. One note is that on the simulator we do get the following warning right after invalidating the running session: -[WKExtendedRuntimeSession _invalidateWithError:]_block_invoke_2:527: Got error Error Domain=com.apple.CarouselServices.SessionErrorDomain Code=3 "Session not running <CSLSession: 0x600003b4eca0; pid: 8833; dismissed: NO; ended: YES; duration: 3600.0; autoEnd: NO; launchable: NO; mutuallyExclusive: YES; managed: YES; persisted: NO; requiresFGActiveInitiation: YES; lastForeground: 2024-03-20 12:01:21 +0000> |CSLSSession = { | sessionID: 4894EB1D-96F7-4921-8263-378E304E719F; bundleID: com.bundle; type: "physical therapy"; running: NO; paused: NO; expirationDate: 2024-03-20 13:01:10 +0000; supportsAOT: NO; lastStartWasScheduled: NO; remote: NO; |}" UserInfo={NSLocalizedDescription=Session not running <CSLSession: 0x600003b4eca0; pid: 8833; dismissed: NO; ended: YES; duration: 3600.0; autoEnd: NO; launchable: NO; mutuallyExclusive: YES; managed: YES; persisted: NO; requiresFGActiveInitiation: YES; lastForeground: 2024-03-20 12:01:21 +0000> |CSLSSession = { | sessionID: 4894EB1D-96F7-4921-8263-378E304E719F; bundleID: com.bundle; type: "physical therapy"; running: NO; paused: NO; expirationDate: 2024-03-20 13:01:10 +0000; supportsAOT: NO; lastStartWasScheduled: NO; remote: NO; |}} This appears to be thrown by some part of Carousel, for which no public documentation exists, and it clearly doesn't disrupt the expected behavior on the simulator. I don't know if this is being thrown on the device, since our logging wouldn't be able to pick it up. Please let me know if we are approaching this incorrectly or if there are any known solutions to this issue.
Posted
by bcappdev.
Last updated
.
Post not yet marked as solved
5 Replies
285 Views
It's not just me that the watch doesn't show up in Xcode 15.3, Watch 10.4, iOS 17.4.1, right? In Xcode, the Mac and iPhone are connected and displayed, but only the watch is not working. And when I run the complication app, oddly enough, it prompts to install the app on the iPhone device's watch app? It's really strange, isn't it? But the installation doesn't actually happen. It seems like a funny thing with Apple. Does anyone know when this will be fixed?
Posted
by DongSik.
Last updated
.
Post not yet marked as solved
0 Replies
208 Views
I understand that the Nearby Interaction framework is available on watchOS 8+, and I want to make a watch app that displays distance estimation between multiple watches (not iPhones) using UWB through Nearby Interactions. I see in the documentation that an iPhone can discover multiple device "discovery tokens" and create NISessions with them using the Multipeer Connectivity framework, but it looks like the Multipeer Connectivity framework is not available on watchOS? So, how might I make an independent watch app that can discover multiple nearby watches and setup NISessions with them? Thanks!
Posted
by milst.
Last updated
.
Post not yet marked as solved
6 Replies
1k Views
Our app is pushed to supervised iPhones through our MDM. We have a watchOS companion app that we install to paired Apple Watches as well. Our watches are NOT enrolled in the MDM using the new watchOS 10 MDM features, and are just paired normally to the supervised phones. Historically (the past 2 years), the watchOS companion app has been installed automatically after our iOS app has been pushed by our MDM (through VPP) and the Watch has been paired. NEW IN iOS 17.4/watchOS 10.4, the watchOS companion app is NOT installed automatically and when we press “Install” in the Watch app on the iPhone, we see a spinner for about 1 second and then a silent failure, with the button reverting back to “Install”. This is occurring with other apps purchased through VPP. We purchased the CityMapper app through VPP, assigned it to a supervised iPhone, and attempted to install CityMapper's watchOS companion app and got the same failed result. This is NOT occurring on a clean & reset supervised iPhone and its paired watch running iOS 17.3.1 / watchOS 10.3. On a personal unsupervised device running iOS 17.4/watchOS 10.4 with a copy of our app purchased through the App Store, installing the watchOS companion app is not an issue. I filed radar FB13687404 but in 10 years of developing for iOS, I have never ever ever heard of Apple responding to one of those. Posting here in the hope that other users/developers can share their issues or solutions.
Posted
by bcappdev.
Last updated
.
Post not yet marked as solved
2 Replies
129 Views
Could you please provide clarification on whether WatchOS currently supports the real-time or on-demand measurement of skin temperature and ambient temperature? If so, Could you also guide us on the relevant APIs or resources available for incorporating these features into out applications?
Posted
by Snkr006.
Last updated
.