I’ve spent a long time building an extensive watch face “bench” and it’s been extremely satisfying. I’m just getting into (mechanical) watch collecting and have been recreating watch faces that I can run on my Apple Watch Ultra 4. This allows me to “test drive” watches to try to determine what I really like, particularly which variant/colorway, as some brand catalogs are huge.
I already did a quick post on how to hide the system time Apple displays in the upper-right-hand corner of every watchOS app. That was super useful. Here, I outline how to, sort of, get access to the ambient light sensor on an Apple Watch.
My watch faces support a “night mode” where the main face dims significantly and the furniture that is painted with lume glows. I can activate night mode with a gesture but I always wanted it to turn on automatically. After doing a lot of research, Apple simply does not allow you access to the ambient light sensor (yes, certain research studies have access but it’s not real-time). What does work as a pretty good proxy is reading the brightness level of the screen.
You need to load Apple’s private BackBoardServices framework with dlopen and look up the C function BKSDisplayBrightnessGetCurrent with dlsym. That function returns the current backlight level as a number from 0.0 to 1.0. My office, which doesn’t have any windows but has decent lighting, registers about 0.45. When AOD is activated, that drops the brightness to about 0.2ish, which is very close to where I wanted “autolume” to turn on, so it’s been a bit tricky. Still, great fun. Hopefully this helps if you are looking to do something similar.