Learn · Operating systems

macOS

Settings live in property lists, file changes in FSEvents, downloads in a quarantine database, and almost everything else in the unified log. Times count from 2001.

1 Where the artefacts live

ArtefactLocationTells you
Preferences~/Library/Preferences/*.plist, /Library/Preferences/app settings, recent documents, last launch, network and Bluetooth history
Launch agents and daemons~/Library/LaunchAgents/, /Library/LaunchAgents/, /Library/LaunchDaemons/persistence: what starts at login or boot
Unified log/private/var/db/diagnostics/ (.tracev3) + /private/var/db/uuidtext/logins, unlocks, USB, app starts, network, everything that logs
FSEvents/System/Volumes/Data/.fseventsd/ (and .fseventsd on every volume)files created, renamed, deleted, also on USB sticks
Quarantine database~/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV2downloads: URL, app, time
Knowledge / Biome~/Library/Application Support/Knowledge/knowledgeC.db; newer: ~/Library/Biome/app usage, focus, device state (format changes between versions)
Privacy permissions/Library/Application Support/com.apple.TCC/TCC.db (+ per user)which app may use camera, microphone, disk, screen
Safari~/Library/Safari/History.db, Downloads.plistbrowsing history (Cocoa time), downloads

Since macOS 10.15 the system volume is read-only and user data sits on /System/Volumes/Data. Full Disk Access and System Integrity Protection decide what even a root shell can read; on Apple-silicon Macs the disk is always encrypted, so collect from the running, unlocked system or with the user's password.

2 Property lists

A property list stores a tree of dicts, arrays, strings, numbers, dates and data. The same content can be XML (<?xml …><plist>) or binary (bplist00); plutil -p file.plist prints either. The binary format is a sequence of objects, an offset table that says where each object starts, and a 32-byte trailer that says where the table is. Containers do not hold their content, only object numbers.

Headerbplist00
Objectsmarker byte (type + size) and payload, big-endian
Offset tableone offset per object
Trailersizes, object count, top object, table offset

The sample is the preferences file of an invented notes app. Read it the way a parser does: start at the trailer, find the offset table, then the top object (a dict), then its keys and values.

What plutil -p prints (builder output)

Dates are 8-byte big-endian floats in Cocoa time (marker 33). The recent-documents list names a file on /Volumes/TRAVEL: an external volume that is not attached any more. Apps keep such lists in their own plists; the system-wide list is in com.apple.sharedfilelist.

3 Launch agents

launchd starts every job described by a plist in the LaunchAgents and LaunchDaemons folders. An agent in the user's own folder needs no administrator rights, which makes it the first place to check:

<!-- ~/Library/LaunchAgents/com.example.syncd.plist -->
<plist version="1.0"><dict>
  <key>Label</key>            <string>com.example.syncd</string>
  <key>ProgramArguments</key> <array><string>/Users/robin/Library/Application Support/.syncd/syncd</string></array>
  <key>RunAtLoad</key>        <true/>
  <key>StartInterval</key>    <integer>3600</integer>
</dict></plist>

Since macOS 13 the system also tracks login items and background tasks in one database (sfltool dumpbtm lists them) and notifies the user when one is added; that notification is logged in the unified log.

4 FSEvents: a journal of file changes

The FSEvents daemon records changes to the file system so that Spotlight, Time Machine and apps can catch up. It writes them, gzip-compressed, into small files in .fseventsd on each volume. After gunzip a file is one or more pages of records: path, event ID, flags and (from version 2) the node ID.

Records as a table (builder output)

Read the events in order: an installer package arrives in Downloads, a hidden folder and a launch agent are created in the Library (the agent from section 3), a volume called TRAVEL is mounted, and a contacts file is moved to the Trash (two Renamed events with the same node ID) and then removed. There are no timestamps: event IDs only give the order. Dates come from the modification time of the .fseventsd file and from other artefacts with times, such as the quarantine database below.

5 The quarantine database

When a browser, mail client or chat app saves a downloaded file, macOS adds the extended attribute com.apple.quarantine to the file and a row to the user's QuarantineEventsV2 SQLite database. Gatekeeper uses both to warn before the first start. The attribute and the row share a UUID:

$ xattr -p com.apple.quarantine ~/Downloads/syncd-installer.pkg
0083;6aa8f440;Safari;2B8E6C1A-4F7D-4E19-9C3B-7A1D5E2F8C40

Flags; the download time as hex Unix seconds (0x6aa8f440 = 2026-09-15 07:31:12 UTC); the app; the UUID of the database row. The row adds the URL and the page it came from, with the time in Cocoa seconds:

What sqlite3 returns (builder output)

Only two live rows, but the unallocated space of the page holds a third one: wipe-free-space.dmg from tools.example.net. Its row was deleted, and because it was the lowest cell on the page SQLite merged its space into the unallocated area instead of a freeblock (the SQLite page explains both cases). Users and cleaning tools delete these rows; the bytes often stay.

6 The unified log

Since macOS 10.12 nearly all logging goes to the unified log: binary .tracev3 files whose format strings live in uuidtext. Do not copy single files; collect an archive and read it with log (or the open-source parsers for other platforms):

sudo log collect --last 3d --output case.logarchive
log show --archive case.logarchive --start "2026-09-15 07:00:00" --end "2026-09-15 08:30:00" \
  --predicate 'process == "loginwindow" OR subsystem == "com.apple.securityd"' --info

Retention is short (days to weeks, depending on volume and level) and many messages hide personal data as <private>. Collect early, and expect gaps.

7 Try it yourself

Answer from the hex views above.

How many objects does the property list contain?

The object count is the 8-byte big-endian number at offset 8 of the trailer (the last 32 bytes).

Trailer at 0xC3; bytes 0xCB–0xD2 are 00 00 00 00 00 00 00 0C = 12 objects: the dict, 5 key strings, the date, 2 more strings, the integer, the array and true. The path string appears only once although two keys use it: objects can be shared.

Which single byte stores the value true of ShowSidebar?

Follow the last value reference of the dict to its object and read its marker.

Object 11 at 0xB6 is the single byte 09: type 0 (null/bool), low nibble 9 = true (8 = false, 0 = null). Booleans have no payload.

What happened to old_contacts.vcf, according to FSEvents?

Compare the node IDs and flags of events 5 to 7.

Events 5 and 6 are a rename pair with the same node ID 8,771,020: from Documents to .Trash. Event 7, same node, is Removed: the Trash was emptied. A copy would create a new node ID. FSEvents of the TRAVEL volume would be in that volume's own .fseventsd, which you need the stick for.

From which host was the deleted download in the quarantine database fetched?

Look at the unallocated space of the database page in section 5.

tools.example.net: the leftover row contains https://tools.example.net/files/wipe-free-space.dmg and the agent com.apple.Safari. Its Cocoa timestamp also survives in the bytes before the bundle identifier.

These 51 bytes hold the date object, a string and the integer LaunchCount (file offset 0x5D on). Edit them and watch the decoded list:

  • Change the integer at 0x8E from 2A to FF. LaunchCount becomes 255. What would you have to change to store 1,000?
  • Reset, then change the date marker at 0x5D from 33 to 23. The same 8 bytes are now a plain real number. How many seconds after 2001 is the launch?
  • Reset, then change the first date byte at 0x5E (41) to 42. The date jumps out of any sensible range. Which part of an IEEE 754 float did you change?