While this isn't a full solution (yet), I just stumbled across an app (Timing) that claims it can import from the Screen Time data.
Skimming through the getting started steps, it basically seems like they're using 'share screen time data with other devices', and then reading from the local database/etc somewhere on macOS that stores it.
To set up the Screen Time importer, open the Timing integration preferences and add the Screen Time integration. You will be asked to complete three steps:
To set up the Screen Time importer, open the Timing integration preferences and add the Screen Time integration. You will be asked to complete three steps:
- Enable Screen Time in System Settings on your Mac and enable sharing Screen Time data across devices. This is required so that your mobile Screen Time data can be synced to your Mac.
- Enable Screen Time on your mobile devices and enable sharing Screen Time data across devices. This is required for your mobile device to record data that Timing can import.
- Finally, grant Timing the "Full Disk Access" permission in System Settings. This is required for Timing to read your Screen Time database.
Some further digging/research led me to this StackOverflow answer, which referred to a blog post by Sarah Edwards titled Knowledge is Power! Using the macOS/iOS knowledgeC.db Database to Determine Precise User and Application Usage, which dives into a bunch of the details about the location of the SQLite database, a number of the tables within it, and some queries for extracting data from them.
Based on that, we can see that the database containing the Screen Time data is located at:
~/Library/Application\ Support/Knowledge/knowledgeC.db
We can confirm that this is a SQLite database by using the file
command:
⇒ file ~/Library/Application\ Support/Knowledge/knowledgeC.db
/Users/devalias/Library/Application Support/Knowledge/knowledgeC.db: SQLite 3.x database, last written using SQLite version 3039005, writer version 2, read version 2, file counter 18507, database pages 7624, 1st free page 106, free pages 137, cookie 0x5a, schema 4, largest root page 50, UTF-8, vacuum mode 1, version-valid-for 18507
I also collated the above, along with a few other notes/references about the Screen Time database on a GitHub gist for future reference: