watchOS is the operating system for Apple Watch.

Posts under watchOS tag

200 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

App Logo Above Watch Face on Apple Watch
I am running two different background modes(not at the same time), 1 with a workout and 1 with a location. I noticed that the app logo appears above the watch face for both background modes but does not show up consistently. I wonder what the significance of the logo showing up above watch face is? Additionally why does it show up sometimes but not others? Thanks
0
0
153
2w
watchOS app gets killed by filecoordinationd when in Always on mode
Hi, I have a watchOS app which is able to control Sonos speakers. So people set it to stay active for 1 hour. Unfortunately, the system kills the application every time after 5 to 15 min. I have made many system diagnosis and the pattern is always the same. Carousel decides that the app must be suspended. runnungboardd suspends the app. filecoordinationd kills with SIGKILL because it detected it has been suspended. launchd reports that the app has been killed. The issue is that I don't understand why Carousel wants to suspend the app. I have disabled all animations while the app is in Always on mode. The app does not perform any operations. If anyone has any idea on what do try, I would be glad for help. Here are some of the related logs. There are thousands around that but I could not deduce anything useful from them. The app gets suspended and then the filecoordinationd decides to kill it. But why is it suspended ? Just before, the app invalidates the timelines. But the timelines here are from the Backlight service. debug 2024-05-11 10:19:47.116194 +0200 WatchSonos WatchKit Extension 0x16d57dd0 invalidateAllTimelinesForReason:Host update. for environment:de.heinrich.alexander.WatchSonos.watchkitapp default 2024-05-11 10:19:47.116285 +0200 WatchSonos WatchKit Extension [(FBSceneManager):de.heinrich.alexander.WatchSonos.watchkitapp] Sending action(s): BLSInvalidateFrameSpecifiersAction Here an error occurs when setting the darwin gpu. This could be related default 2024-05-11 10:19:47.176223 +0200 runningboardd [app<de.heinrich.alexander.WatchSonos.watchkitapp((null))>:1706] Shutdown sockets (ALL) default 2024-05-11 10:19:47.176259 +0200 runningboardd [app<de.heinrich.alexander.WatchSonos.watchkitapp((null))>:1706] Set darwin role to: None default 2024-05-11 10:19:47.176264 +0200 runningboardd 1706 Set Darwin GPU to "deny" error 2024-05-11 10:19:47.176292 +0200 runningboardd 1706 setGPURole failed with result = e00002c7 Here the carousel requests suspension which then later performed by the runningoardd default 2024-05-11 10:19:47.177176 +0200 Carousel [app<de.heinrich.alexander.WatchSonos.watchkitapp((null))>:1706] Setting process task state to: Suspended info 2024-05-11 10:19:47.177309 +0200 Carousel Client requesting suspension of PID:1706 Name:<redacted> info 2024-05-11 10:19:47.177407 +0200 Carousel Update delivered for [app<de.heinrich.alexander.WatchSonos.watchkitapp((null))>:1706] with taskState 3 Suspending the process default 2024-05-11 10:21:13.851752 +0200 runningboardd [app<de.heinrich.alexander.WatchSonos.watchkitapp((null))>:1707] Suspending task. info 2024-05-11 10:21:13.851963 +0200 runningboardd Process: [app<de.heinrich.alexander.WatchSonos.watchkitapp((null))>:1707] has changes in inheritances: {( <RBSInheritance| environment:UIScene:@com.apple.frontboard.systemappservices/FBSceneManager:de.heinrich.alexander.WatchSonos.watchkitapp name:com.apple.frontboard.visibility origID:74-186-52947 payload 646688203>, <RBSInheritance| environment:(none) name:com.apple.frontboard.visibility origID:74-186-53033 0> )} info 2024-05-11 10:21:13.852269 +0200 runningboardd Current inheritances: {( <RBSInheritance| environment:(none) name:com.apple.frontboard.visibility origID:74-186-53032 0>, <RBSInheritance| environment:UIScene:@com.apple.frontboard.systemappservices/FBSceneManager:de.heinrich.alexander.WatchSonos.watchkitapp name:com.apple.frontboard.visibility origID:74-186-52947 payload 646688203>, <RBSInheritance| environment:(none) name:com.apple.frontboard.visibility origID:74-186-52948 0>, <RBSInheritance| environment:(none) name:com.apple.frontboard.visibility origID:74-186-53033 0> )} default 2024-05-11 10:21:13.852375 +0200 runningboardd Process: [app<de.heinrich.alexander.WatchSonos.watchkitapp((null))>:1707]: Sending inheritance changeset: <RBSInheritanceChangeSet| gained:{( )} lost:{( <RBSInheritance| environment:(none) name:com.apple.frontboard.visibility origID:74-186-53032 0>, <RBSInheritance| environment:(none) name:com.apple.frontboard.visibility origID:74-186-52948 0> )}> default 2024-05-11 10:21:13.852794 +0200 runningboardd [app<de.heinrich.alexander.WatchSonos.watchkitapp((null))>:1707] Shutdown sockets (SVC) default 2024-05-11 10:21:13.852829 +0200 runningboardd [app<de.heinrich.alexander.WatchSonos.watchkitapp((null))>:1707] Set darwin role to: None Killing the process: default 2024-05-11 10:19:48.441773 +0200 filecoordinationd Detected process suspension: 1706 info 2024-05-11 10:19:48.441776 +0200 filecoordinationd Update delivered for [app<de.heinrich.alexander.WatchSonos.watchkitapp((null))>:1706] with taskState 4 default 2024-05-11 10:19:48.441776 +0200 filecoordinationd Claim 562AB55E-CE67-46FA-A080-798F89013643 observed suspension of client with 1706 error 2024-05-11 10:19:48.444295 +0200 filecoordinationd SimulateCrash() on another process is not supported default 2024-05-11 10:19:48.444361 +0200 filecoordinationd Claim 562AB55E-CE67-46FA-A080-798F89013643 was revoked Reporting the kill default 2024-05-11 10:19:48.455485 +0200 launchd exited due to SIGKILL | sent by filecoordinationd[316], ran for 7913ms
0
0
141
3w
How to add "Estimated Time in Each Heart Rate Zone" info to my custom HKWorkout when viewed in Apple Fitness app?
Hello, I’m currently developing a fitness app for watchOS that lets a user to manually set a desired heart rate target zone (enter numbers representing the lower and upper boundaries) and start a workout (right now it’s only “Other” type). After that my app monitors user’s heart rate and alerts them when they’re out of zone. When user ends the workout, the info about this workout appears on “Fitness” iOS app, and user can see the workout data like Workout Time, Active and Total Calories, Avg. Heart Rate. Also user can see Heart Rate chart with info how their heart rate was changing during a workout (see the Figure 1). Now to the question. When user clicks “Show More” button above the Heart Rate chart, they can see the same Heart Rate chart and another one, with Post-Workout Heart Rate (see the Figure 2). But there is no “Estimated time in each heart rate zone” as one can see in the workout’s details that were recorded from Apple’s workout (watchOS “Workout” app, for a workout of “Other” type as well). Please see the Figure 3. The question is: is it possible to add “Estimated time in each heart rate zone” to workout recorded via my third-party app so it would look like on the Figure 3 in "Fitness" iOS app, and if it's possible, what steps should I undertake to implement this ? Thanks in advance! I posted the screenshots in the replies to the post, because otherwise I was not able to submit a post ("sensitive language" warning, I suspect it's because of the ids in the attached screenshot's urls)
1
0
213
3w
WidgetKit - complication doesn't sync between watch and iPhone
I'm currently working with complication using widgetkit for watchOS. When I select complication from Watch app in iPhone, The complication does not show content. In complication gallery, untitled complication is selecting. But when I select complication from watch, it's OK. This bug occurs in both real device and simulator. But it happen in some pair. Example: watch ultra (os 10.4) pair with iPhone 14 pro (os 17.0): NG watch ultra (os 10.4) pair with iPhone 14 pro (os 16.1): NG watch ultra (os 10.0) pair with iPhone 14 pro (os 17.0): OK I tried create simple project to check this bug. But this bug still occurs This is sample project: Github
0
0
183
3w
Apple Watch cannot reconnect
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?
36
10
10k
3w
Title: Issues with NSExtensionMainStoryboard or NSExtensionPrincipalClass in Widget Extensions for iOS 14
I'm working on an app that has the following structure: MyApp MyWidgetExtension MyWatchKitApp -- MyWatchKitAppExtension ---- MyWatchKitAppWidgetExtension Both MyWidgetExtension and MyWatchKitAppWidgetExtension were developed using a shared MyWidgetBundle defined as follows: @main struct MyWidgetBundle : WidgetBundle However, I'm running into an issue when attempting to run this on devices with iOS 14. I get an error stating "App extensions must define either NSExtensionMainStoryboard or NSExtensionPrincipalClass keys in the NSExtension dictionary in their Info.plist." Interestingly, if I remove MyWatchKitAppWidgetExtension, the app installs just fine. But, if I add NSExtensionPrincipalClass or NSExtensionMainStoryboard, when I try to distribute the app to TestFlight, I receive an error stating "Unexpected key NSExtensionPrincipalClass found in extension Info.plist". I'm at a loss as to how to resolve this issue. Does anyone have any suggestions or insights?
2
1
979
May ’24
WatchOS simulator - Cannot play sounds while iPhone simulator works
Hello, everyone, I have a problem I'm stuck with and have been trying to solve without success for the past 2 weeks. I am developing a SwiftUI application for Apple Watch which for now I am only running on the simulator. This application has to play sounds but unfortunately so far without success for Apple Watch simulator. When I tap the button on the application running on the Series 9 (45mm) simulator with watchOS 10.2. I cannot hear any sounds on my MacBook Pro. This happens for all Apple Watch simulators I have in my MacBook. The same exact code works on the iPhone 15 simulator with iOS 17.2 and I hear the file 1.mp3 from MacBook Pro speakers and also from bluetooth hearphones, if I connect them. The code is this import SwiftUI import AVFoundation struct ContentView: View { @State var audioPlayer:AVPlayer? @State var isPlaying : Bool = false var body: some View { VStack { Image(systemName: "globe") .imageScale(.large) .foregroundStyle(.tint) Text("Hello, world!") Button("Play"){ if let path = Bundle.main.path(forResource: "1", ofType: "mp3") { let fileUrl = URL(fileURLWithPath: path) do{ try AVAudioSession.sharedInstance().setCategory(AVAudioSession.Category.playback) try AVAudioSession.sharedInstance().setActive(true) audioPlayer = AVPlayer(url: fileUrl) guard let audioPlayer = audioPlayer else { return } audioPlayer.play() } catch { } } } } .padding() } } Thanks for your support!
1
1
166
Apr ’24
Xcode 15 - Apple Watch Companion Embed Not Working
The iPhone Target Build Phase for my Apple Watch companion app specifies the source of the Product to embed as: build/Debug-watchos, however, the Watch build is located at build/Debug-watchsimulator. I am receiving an error from Xcode when trying to install the Apple Watch app in the watch simulator, as follows: An application bundle was not found at the provided path. Provide a valid path to the desired application bundle. Failed to install the requested application Domain: NSPOSIXErrorDomain Code: 2 Failure Reason: An application bundle was not found at the provided path. Recovery Suggestion: Provide a valid path to the desired application bundle. I have tried deleting the Watch target and re-adding the target but the misconfiguration remains. I have also tried adding my own Copy Build Phase but when selecting the Product for the Apple Watch companion app the same incorrect folder is used. Any ideas?
14
3
2.8k
Apr ’24
Finishing a HKLiveWorkoutBuilder workout with lots of HKWorkoutActivity instances is very slow
I'm using the new watchOS 9 HKWorkoutActivity in my interval training app (Intervals Pro) for each interval. It's a great addition since all the intervals now show in the Apple Fitness app, however, if the workout has lots of activities then saving the workout is painfully slow. For example, on my Apple Watch Ultra I saved a workout with 63 activities and it took more than 1 minute. Here's a code snippet: try await builder.endCollection(at: workoutEndDate) try await builder.addMetadata(metadata) try await builder.finishWorkout() // This is SLOW Is anyone else having the same issue? To demonstrate the issue you can look at a Test Flight build of Intervals Pro: https://testflight.apple.com/join/Nn7iSOzY Tap on the More tab in the iPhone app and then the Apple Watch Settings. On that screen you'll see a switch to either enable or disable workout activities. To demonstrate the issue, edit a timer to continue until manually stopped by changing the Number of Cycles to "Until Stopped". Then start the timer on the watch. Let it run for a period of time to create more than 50 intervals, for example, then stop the timer. Swipe to the leftmost screen on the watch, tap pause, then tap end. At that point you'll see how slow the workout saved. Next, you can go back to the iPhone app, disable using workout activities and repeat the test. The workout will save quickly in this case. I've filed a feedback.
2
0
638
Apr ’24
Usage of `NavigationLink` and `.navigationDestination` causing console error logs
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)
1
0
672
Apr ’24
Detecting when Workout Session is being forcibly closed/ended
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
0
0
211
Apr ’24