XCode - Apple Watch Connectivity

Hi Devs,

I'm working with WatchOS for the first time and am having a frustrating time with Xcode to Watch, to say the least. I have a Series 9 dev watch and Xcode does not reliably connect to it. Spending 15-20 min per build/run attempt just trying to get xcode to find and connect to the watch.

It WILL sometimes recognize and allow a build to run, the issue is I can't tell any reliable way to establish the connection. It drops after every build and leaves me at square zero. Current solution is some amount of force quitting, reconnecting iPhone to USBC, disconnecting watch to wifi and back on.

Devices Window usually reads: Previous preparation error: A connection to this device could not be established.; Timed out while attempting to establish tunnel using negotiated network parameters - swapping to some attempting to connect state that never (reliably resolves).

Is this why no one builds for WatchOS?

Hoping someone has pro tips on this.

I can't help in any consistent way as after looking in the docs and asking chatGPT I'm getting exactly this issue, I just wanted to share the pain...

It's my first time building a watch App too and it's a really simple app. It was installing fine every single time for weeks but then something happened and since then it's been a nightmare: everything seems fine, I test the iOS app and it works fine and I test the watch app and it installs and runs but I need to change the code. I stop the app.

I rebuild on iOS and it's good then I go to do the same on the watch but it spins and I get exactly the error that you have! I am getting SO fed up with it.

In D&S I unpair the watch, quit Xcode, restart my watch, I enter my code, trust the Mac and then try to find it in Xcode but it doesn't show. I restart Xcode and then the watch sometimes appears but it's trying to update/connect to the watch and fails with the same error.

I did restart my Mac and that perhaps cleared the issue and it will install on the watch but then on the next attempt to install the watch app 5 minutes later and it's the same error again.

Like you, it's taking around 20 minutes to install the watch app (let alone actually test it!) what with the unpairings, Mac restarts, toggling of Developer mode & restarting the watch, cache clears and the rest.

I can 'fix' it, but I never know what step out of the 10 things I tried was the one that actually made it work again.

This is a drag and no fun at all. I have another app I'm planning and that would have a much more involved watch app, but given this mess I'm not sure I have the stamina. This reminds me uncomfortably of the early days of iOS development with all the code signing hell that we had to go through.

So, I'd suggest combinations of unpairing in D&S, toggling Developer mode on the watch and restarting both Xcode and your Mac - some or all of these eventually get it working again but of course it might break 5 minutes later and it's back to the start.

Come on Apple - it surely doesn't have to be this unbearably tedious to develop a watch app?

Hey coastaldev. I have actually gotten a lot closer to xcode connectivity reliability by connecting watch to wifi directly. presumably the same wifi or tether as computer running Xcode though that’s not tested. But largely helped prob boosted success rate to 70%. hope that helps, do let me know as I’m curious.

XCode - Apple Watch Connectivity
 
 
Q