ScreenTime2CSV is a Python script to query Screen Time data from the macOS knowledgeC.db database and export it to CSV format.
- MacOS device signed into the same iCloud account
- Screen Time "Share across devices" enabled
More info in my blog post Exporting and analyzing iOS Screen Time usage
usage: screentime2csv.py [-h] [-o OUTPUT] [-d DELIMITER]
Query knowledge database
options:
-h, --help show this help message and exit
-o OUTPUT, --output OUTPUT
Output file path
-d DELIMITER, --delimiter DELIMITER
Delimiter for output file (default: comma)
python screentime2csv.py -o output.csv
This command will export Screen Time data to output.csv using comma as the delimiter.
python3 screentime2csv.py -o output.tsv -d '\t'
This command will export Screen Time data to output.tsv using tabs as the delimiter.