Xcode Devices & Simulators Window
I had a lot of trouble finding out how to get my freshly developed App onto my Apple Watch for testing.
As the watch is primarily tied to my iPhone, I first thought my app would be installed onto the watch through my iPhone, sort of like when you get an iOS app from the App Store, which has a companion app for the watch… you can then use the “Watch” app on iPhone to “install” the app on the Watch.
But no, it doesn’t work like that at all. Xcode connects directly to the watch and uploads directly to it.
Actually, I now think the iPhone never pushes an app to the Watch. I think all it does is tell the watch to go download the Watch app from the App Store… but that remains to be confirmed…
Practically…
-
In order for Xcode to see the watch, bluetooth needs to be ON, both on the watch AND on the Mac!
-
Furthermore, for any upload to take place, the watch must also have WiFi turned on… but if the Mac is connected by Ethernet and the Watch is on WiFi but on a different networks (like different VLANs), that still won’t work…
-
However, if you now turn on WiFi also on the mac, they will finally be able to communicate! 🎉
-
I initially thought that the Mac and the Watch would negotiate an ad-hoc WiFi network between them, but lately it does not seem to work any more. Maybe I was mistaken. In doubt, make sure the Mac and the Watch actually connect to a WiFi Access Point.
-
You may also need to check that the watch is actually connected to a WiFi network. Watch Settings > WiFi.
-
And all that still may not be enough! For Xcode to initially connect to the watch, you also need to turn on Bluetooth (and possible WiFi) on the iPhone that the watch is associated with (even if said iPhone is on an Ethernet plug…)
It’s the shame the Xcode UI only has cryptic error messages and no clear indications about turning on Bluetooth and WiFi on the Mac, as it’s ridiculously easy for Xcode to check for that!