Got a Watch SE recently only to find out that I can't deploy apps to it from Xcode even once.
I always get the message "Connecting to Watch" and "Reconnecting to Watch".
Tried with Xcode 16 and then with 16.2. Same result.
For countless times, I have tried every possible solution posted on this forum and elsewhere but to no avail.
Filed a feedback, no reply yet from Apple.
Looks like something is seriously broken. Please fix this.
FB16122816
Posts under watchOS tag
200 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
I have a depended watch app bundled with my iOS app.
// ...
<key>WKRunsIndependentlyOfCompanionApp</key>
<false/>
// ...
My code:
guard WCSession.isSupported() else {
return
}
let session = WCSession.default
session.delegate = self
session.activate()
public func session(_ session: WCSession, activationDidCompleteWith activationState: WCSessionActivationState, error: Error?) {
// ...
if (session.activationState == .activated) {
let log = Log(isPaired: session.isPaired, isWatchAppInstalled: session.isWatchAppInstalled)
uploadLogToServer(log)
}
// ...
}
and also:
guard WCSession.isSupported() else {
return
}
let session = WCSession.default
guard session.activationState == .activated, session.isWatchAppInstalled else {
return
}
do {
try session.updateApplicationContext(...)
} catch {
uploadErrorToServer(error)
}
What I've observed is that when I query the logs in the server's database, I get entities with isPaired = false and isWatchAppInstalled = true.
Also, when I query the errors I see deviceNotPaired errors.
So my question is, does Should WCSession.isPaired property be true before accessing WCSession.isWatchAppInstalled property ?
Hello, since an update in September, the alarm widget on the watch face no longer counts down accurately like it used to.
This is extremely frustrating for me because I used it for work so I have know exactly how much time I had in a particular circumstance.
So for example, say I have an alarm set for 12:30. Before the update in September, I was able to look at my watch and know immediately that I had 24 minutes before the alarm, or look again and know it was the. 10 minutes before the alarm.
Now, if I look at the watch face, it will say I have 24 minutes before the alarm, but it may actually only be 10 minutes before the alarm.
I understand for some people this may be trivial, but it is really disappointing for me, and renders one of the most useful features of the Apple Watch useless to me now.
I am hoping this is just an oversight during an update, so looking to see if this is something that is currently being worked on?
I just installed beta 11.3 and still having the same issue.
Now, if I press and hold on the watch face, like I’m going to change watch faces, then click out of it. It does update it. But it is not the same as it used to be.
Thank you
Hi,
I've had trouble for a while now with HealthKit giving me different values if I make the request on iOS and WatchOS.
I am using the exact same method on both with the same parameters but I get vast differences in the results.
The code I am using to call HealthKit on both devices is:
let dateRange = HKQuery.predicateForSamples(withStart: Date().removeMonths(numberOfMonths: 1), end: Date().endOfDay())
let predicate: NSPredicate
predicate = NSCompoundPredicate(type: .and, subpredicates: [dateRange])
let query = HKStatisticsQuery(quantityType: HKQuantityType(.stepCount), quantitySamplePredicate: predicate, options: .cumulativeSum) { _, result, error in
if error != nil {
//print("Error fetching step count, or there is no data: \(error.localizedDescription), \(startDate) -> \(endDate)")
onComplete(0)
return
}
if let result, let sum = result.sumQuantity() {
let stepCount = sum.doubleValue(for: HKUnit.count())
DispatchQueue.main.async {
onComplete(Int(stepCount))
}
}
}
healthStore.execute(query)
}
I have tried all of the above options, cleaned cached data, restarted several times, did not work.
The tunnel connection failed while the system tried to connect to the device.
Domain: com.apple.dt.RemotePairingError
Code: 4
System Information
macOS Version 15.2 (Build 24C101)
Xcode 16.2 (23507) (Build 16C5032a)
iOs 18.1.1
Crash Log
We have a issue with our watch app. When we do a release build with xcode 16 the watch app will not launch and crashes on watchOS 10 and below devices.
It does not do this on debug builds...and it does not do this on xcode 15 release/debug builds.
Anybody running into watch crashes on xcode 16?
Thanks
Just triple-checking if it's only my Apple Watch Series 8 where the weather widget in the notification area is only showing 'WNW.' I think it's supposed to be showing the weekdays or the temperature.
Whenever I try to build on my Apple Watch using Xcode, I often encounter connection issues. It typically takes about an hour of troubleshooting, including restarting devices, restarting Xcode, erasing the Apple Watch, and other steps. I was wondering if anyone else has experienced similar problems and if there are any effective solutions.
When launching the SimpleWatchConnectivity sample in a simulator (iOS 18.2 + watchOS 11.2), almost all the functionality works, but TransferFile does not work. The error is the following:
-[WCFileStorage persistOutgoingFileTransfer:] error serializing file transfer <WCSessionFileTransfer: ...> due to Error Domain=NSCocoaErrorDomain Code=4866 "Caught exception during archival: This object may only be encoded by an NSXPCCoder."
How can it be fixed or worked around?
The WatchOS Control Center has an Edit/Done button at the bottom, and in its edit mode, elements can be moved around and added/removed.
Yet, the SwiftUI List doesn't have an edit mode on WatchOS.
My question is: is the edit functionality in Control Center a custom thing, or is that present in some SwiftUI component that I've missed?
Hi, so a little context, by environment variables I mean like $HOME in linux. I know that there are some standard and some app specific environment variables in the above mentioned platforms.
Is is possible for the user to set environment variables? If so, what are the ways in which users can set environment variables in the platforms mentioned across the system or for the app as they would in macOS/linux/windows?
And is it possible for developers of the app do the same? If so how?
What I have found so far is that it cannot be done by users, and there is one place in xcode where I, as a developer can set environment variables for my app from the scheme. This isn't available when I ship just the installation binary to the end user, but rather is available only when the app is run using xcode. I just need validation that what I understand is correct and that there aren't other ways to do this by the user/developer without jailbreaking.
I have a fully functioning IOS / Watch App working on hardware and software test. But, I cannot figure out how to get complications to show up:
Xcode itself does not show complication choices in the target settings.
Can't find a clear simple explanation of the various choices in the settings.
Complication choices in the IOS iPhone app settings never appear
Not at all sure how complications get assigned to 'groups' etc.
...been a roadblock for weeks...very confusing area.
Not new to Xcode ( 10+ years experience). But the basic certificate, settings, info list combination seems always to be a massive hurdle to navigate.
I have developed a standalone WatchOS app which runs a stopwatch.
I want to develop a shortcut that launches the stopwatch. So far I have created the Intent file, and added the basic code (shown below) but the intent doesn't show in the shortcuts app.
In the build, I can see the intent metadata is extracted, so it can see it, but for some reason it doesn't show in the watch.
I downloaded Apple's demo Intent app and the intents show in the watch there. The only obvious difference is that the Apple app is developed as an iOS app with a WatchOS companion, whereas mine is standalone.
Can anyone point me to where I should look for an indicator of the problem?
Many thanks!
//
// StartStopwatch.swift
// LapStopWatchMaster
import AppIntents
import Foundation
struct StartStopWatchAppIntent: AppIntent {
static let title: LocalizedStringResource = "Start Stopwatch"
static let description = IntentDescription("Starts the stopwatch and subsequently triggers a lap.")
static let openAppWhenRun: Bool = true
@MainActor
func perform() async throws -> some IntentResult {
// Implement your app logic here
return .result(value: "Started stopwatch.")
}
}
We have a watchOS app in TestFlight that is currently crashing on any device running watchOS 11 and up.
I have an older Apple Watch SE that's capped at 10.6.1 that can run the app just fine, but the same exact install on a newer device fails.
This started happening after I updated my MacBook to macOS Sequoia and Xcode to 16.
In order to get the Watch app to run on the 10.6.1 device, I had to change the Swift Optimization Level from -O to -Osize. I already filed Feedback on this (FB15691116).
I've tried so many different things and have come up with nothing to show for it.
When I look in the IPS file, I see that the crash point in my code on the watchOS 11 device is at
KinesiaUOnWatch`@objc SessionDelegator.session(_:activationDidCompleteWith:error:):
0x3a3f48 <+0>: sub sp, sp, #0x60
0x3a3f4c <+4>: stp x26, x25, [sp, #0x10]
0x3a3f50 <+8>: stp x24, x23, [sp, #0x20]
0x3a3f54 <+12>: stp x22, x21, [sp, #0x30]
0x3a3f58 <+16>: stp x20, x19, [sp, #0x40]
0x3a3f5c <+20>: stp x29, x30, [sp, #0x50]
0x3a3f60 <+24>: add x29, sp, #0x50
0x3a3f64 <+28>: mov x19, x4
0x3a3f68 <+32>: mov x23, x2
0x3a3f6c <+36>: mov x22, x0
0x3a3f70 <+40>: mov w0, #0x0 ; =0
0x3a3f74 <+44>: bl 0x89818 ; symbol stub for: type metadata accessor for Swift.MainActor
0x3a3f78 <+48>: mov x24, x0
0x3a3f7c <+52>: adrp x25, 161
0x3a3f80 <+56>: ldr w25, [x25, #0x654]
0x3a3f84 <+60>: mov x20, x0
0x3a3f88 <+64>: bl 0x8980c ; symbol stub for: static Swift.MainActor.shared.getter : Swift.MainActor
0x3a3f8c <+68>: mov x21, x0
0x3a3f90 <+72>: adrp x0, 166
0x3a3f94 <+76>: add x0, x0, #0xc40 ; lazy protocol witness table cache variable for type Swift.MainActor and conformance Swift.MainActor : Swift.Actor in Swift
Incident Identifier: 08E2F667-7965-4C86-B85E-9E2F03EAA963
Beta Identifier: AD390666-55CB-43B3-9B14-BD3E70F456EB
Hardware Model: Watch6,1
Process: KinesiaUOnWatch [389]
Path: /private/var/containers/Bundle/Application/B571E983-F2B0-40EF-9F0D-8C471CAEB3FB/KinesiaUOnWatch.app/KinesiaUOnWatch
Identifier: com.glneurotech.kinesiau.watchapp
Version: 5.1.0 (510271)
AppStoreTools: 16B39
AppVariant: 1:Watch6,1:11
Beta: YES
Code Type: ARM64_32 (Native)
Role: Foreground
Parent Process: launchd [1]
Coalition: com.glneurotech.kinesiau.watchapp [464]
Date/Time: 2024-12-03 15:12:51.1876 -0500
Launch Time: 2024-12-03 15:12:50.0000 -0500
OS Version: Watch OS 11.1 (22R585)
Release Type: User
Report Version: 104
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x000000002053dd4c
Termination Reason: SIGNAL 5 Trace/BPT trap: 5
Terminating Process: exc handler [389]
But, as I said, this exact app runs just fine on an older watchOS 10.6.1 device.
Has anyone else encountered something like this, or have any ideas on stuff to try?
It may have made sense in the early days of watchOS, but given the Apple Watch is now 10 years old and we have "Standalone" Apple Watch apps, it no longer makes sense to have this seemingly arbitrary limitation of only being able to query 7 days of data on the watch. I have an open feedback (FB7649612) from 2020 with no responses and ask this question every year at WWDC Developer labs. WHY must we still deal with this limitation which only causes other developers to store critical health data in iCloud or on their own servers in order to provide a robust stand alone watch experience on the Apple Watch. Even Apple themselves must either use a separate private API or use iCloud for the new Vitals app. How else can I escalate this request?
I saw in the Xcode 16 release notes that on-device debugging is no longer available on watchOS prior to version 7.0, but I can't even get a signed, compiled app to run on an older watch. The current version I have live in the App Store works just fine on 4.3.2. I have changed no code, I just started building the app with Xcode 16, and now it won't launch on older watches.
Is it no longer possible to update an app for older watches?
Attempting to write my first WatchOS App which builds correctly and refuses to run on my target physical watch. The code runs fine on the simulator.
IOS 18.2, Watch OS 11.2, XCode 16.1
When I run, the pop-up shows:
Connecting to Apple Watch (about 5 seconds)
Apple Watch may need to be unlocked to recover from previously reported preparation errors (less than a second)(needed to screen record to catch the error)
Waiting to reconnect to Apple Watch (lives here indefinitely)
Both the Watch and iPhone were unlocked during the build/run sequence.
The iPhone is in "Developer" Mode, but could not find the switch anywhere on the watch or watch app to enable dev mode.
I want to get the barometric pressure reading from the built-in barometer to display it in my iOS app. When I use CMAltimeter.startRelativeAltitudeUpdates(), my app receives no relative altitude update events, which means I can't view the barometric pressure from the sensor (because that's only contained in CMAltitudeData, not CMAbsoluteAltitudeData. If I use CMAltimeter.startAbsoluteAltitudeUpdates(), I get absolute altitude update events every second or so. NSMotionUsageDescription is set.
I have tried the following things, all of which haven't worked:
Only calling startRelativeAltitudeUpdates() and not startAbsoluteAltitudeUpdates()
Calling CMSensorRecorder.recordAccelerometer(forDuration: 0.1), as suggested in this thread
Calling CMMotionActivityManager.queryActivityStarting(from: .now, to: .now, to: .main), as suggested here
Physically moving my iPhone up and down about 200 feet using an elevator; I see absolute altitude updates which are in line with what's expected, but still receive no relative altitude update events
Calling the same APIs in a watchOS app on an Apple Watch Series 10; I see much less frequent absolute altitude updates, and still no relative altitude updates
I know the barometer sensor is working, because when I move my iPhone up and down even a foot or two indoors, I see an immediate change in the absolute altitude reading that I know wouldn't come from GPS.
This example code, when run on my iPhone 16 Pro running iOS 18.1.1, prints updates started and then updating absolute every second, but doesn't print anything else. The absolute altitude, accuracy, and authentication status fields update (and the auth status shows 3, indicating .authorized), but the relative altitude and pressure fields remain as --.
struct ContentView: View {
@State private var relAlt: String = "--"
@State private var relPressure: String = "--"
@State private var absAlt: String = "--"
@State private var precision: String = "--"
@State private var accuracy: String = "--"
@State private var status: String = "--"
var body: some View {
VStack {
Text("Altitude: \(relAlt) m")
.font(.title3)
Text("Pressure: \(relPressure) kPa")
.font(.title3)
Text("Altitude (absolute): \(absAlt) m")
.font(.title3)
Text("Precision: \(precision) m")
.font(.title3)
Text("Accuracy: \(accuracy) m")
.font(.title3)
Text("Auth status: \(status)")
.font(.title3)
}
.padding()
.onAppear {
let altimeter = CMAltimeter()
startRelativeBarometerUpdates(with: altimeter)
startAbsoluteBarometerUpdates(with: altimeter)
status = CMAltimeter.authorizationStatus().rawValue.formatted()
print("updates started")
}
}
private func startRelativeBarometerUpdates(with altimeter: CMAltimeter) {
guard CMAltimeter.isRelativeAltitudeAvailable() else {
relAlt = "nope"
relPressure = "nope"
return
}
altimeter.startRelativeAltitudeUpdates(to: .main) { data, error in
if let error = error {
print("Error: \(error.localizedDescription)")
return
}
if let data = data {
print("updating relative")
relAlt = String(format: "%.2f", data.relativeAltitude.doubleValue)
relPressure = String(format: "%.2f", data.pressure.doubleValue)
} else {
print("no data relative")
}
}
}
private func startAbsoluteBarometerUpdates(with altimeter: CMAltimeter) {
guard CMAltimeter.isAbsoluteAltitudeAvailable() else {
absAlt = "nope"
print("no absolute available")
return
}
let altimeter = CMAltimeter()
altimeter.startAbsoluteAltitudeUpdates(to: .main) { data, error in
if let error = error {
print("Error: \(error.localizedDescription)")
return
}
if let data = data {
print("updating absolute")
absAlt = String(format: "%.2f", data.altitude)
precision = String(format: "%.2f", data.precision)
accuracy = String(format: "%.2f", data.accuracy)
}
}
}
}
Is this behavior expected? How can I trigger delivery of relative altitude updates to my app?
I'm trying to figure out how to make an inverted list in my watchOS app for a message view, so that messages appear from the bottom first, and go up.
Everything I've tried so far has some sort of major drawback, and I'm wondering if there's some proper way to do it.
My current implementation is flipping every message item upside-down, then flipping the whole list upside-down. This works in making the list go from bottom to top, but the digital crown scroll direction is also inverted. Simply inverting the array of messages doesn't work either, as the user has to scroll to the bottom of the list manually every time.
Any tips/suggestions would be greatly appreciated.
I have downloaded Xcode 16.1 and after the first run it downloaded 18.1 simulator and then watchOS 11.1 Simulator. Then I suppose it detected my watch 7 with OS 8.1 and wanted to download symbols for it but then it failed with 403 error. Any way to do it some other way?