How to Track App Usage on Mac: 3 Methods Compared
"How long did I spend in Xcode today?" is a simple question with three increasingly involved ways to answer it on macOS. Each has a valid use case; each has limits that are worth knowing before you commit.
This post walks through all three — the built-in Screen Time, a DIY approach with Hammerspoon or osascript, and a dedicated tracker — with a table at the end for quick reference.
Method 1: Apple's Screen Time (built-in, good for a rough read)
Screen Time, buried in System Settings → Screen Time → App Usage, gives you:
- Per-app time totals for today, yesterday, this week, this month.
- A grouped pie chart by Apple-assigned category.
- Per-device aggregation if you're signed into iCloud across a Mac + iPhone + iPad.
What it does well: It's free, zero setup, and if your question is "roughly, which apps did I use today?", it answers that. The per-day roll-up is fine.
Where it breaks down:
- Counts time while the app is frontmost, regardless of whether you were at your desk. Overcounts heavily on days when you stepped away with an app in focus.
- Only sees inside Safari for URLs. If your day is mostly Chrome or Arc, the most important detail (which sites) is missing.
- No focus score, no session length, no switch count — just totals.
- Not categorizable per your own definition of productive.
- Can't export raw data.
Use it when: You want a quick ballpark check and you're a Safari user. Also fine for monitoring a kid's or teen's device, which is what it was designed for.
Don't use it when: You need per-site detail across browsers, you care about actively engaged time (not just foreground time), or you want any notion of focus vs. fragmentation.
Method 2: DIY with Hammerspoon (or osascript + cron)
For developers who want to roll their own, Hammerspoon is a powerful Lua-scriptable macOS automation tool that can watch the active window and log it. A minimal script looks like:
-- Watch active window changes and log app name + timestamp to a CSV
local log = io.open(os.getenv("HOME") .. "/app-usage.csv", "a")
local lastApp = nil
hs.application.watcher.new(function(name, event, app)
if event == hs.application.watcher.activated then
local now = os.date("%Y-%m-%d %H:%M:%S")
log:write(now .. "," .. name .. "\n")
log:flush()
lastApp = name
end
end):start()
That writes one row per app activation to a CSV. You then post-process in a spreadsheet or with awk to compute per-app time.
A shell-only version works too:
# runs every 30 seconds via a launchd job
osascript -e 'tell application "System Events" to get name of first application process whose frontmost is true' \
>> ~/app-usage.log
What DIY does well:
- You own the script, the schedule, the data format.
- Nothing unusual to install. Hammerspoon is well-trusted in the Mac power-user scene.
- Zero recurring cost, zero privacy leakage.
Where DIY breaks down:
- You have to build idle detection yourself (check HID input via IOKit).
- URL tracking requires separately calling
osascriptinto each browser and handling each browser's quirks. Non-trivial. - No UI. You'll be looking at CSVs in a spreadsheet or writing your own dashboard.
- Reliability edge cases (system sleep, fast user switching, app crashes) are all on you.
Use it when: You're a developer who wants total control and doesn't mind writing the code. Or you want to prototype what a full tracker would surface before paying for one.
Don't use it when: You just want data today without building infrastructure, or you want per-browser URL tracking, or you want visual reports.
Method 3: A dedicated tracker (Focus Meter, Timing, RescueTime)
The managed option: install a purpose-built tracker, grant the permissions, and get the full feature set without writing code.
The three main categories:
| Tracker | Architecture | Pricing | Best for |
|---|---|---|---|
| Focus Meter | On-device, SQLite | $19 once | Personal focus tracking, privacy-conscious users |
| Timing | Mostly local, optional sync | $7–14/mo | Freelancers billing hours, project categorization |
| RescueTime | Cloud | $6.50–12/mo | Cross-device users who don't mind cloud |
| ActivityWatch | On-device, open source | Free | Developers, DIY-adjacent, privacy users OK with rough UI |
What a dedicated tracker does well:
- Per-app time with activity-based idle detection (not just foreground time).
- Per-site time in all major browsers, not just Safari.
- Categorization against your own productive / neutral / distracting labels.
- Focus score, session length, context switches — actual focus metrics.
- Reports UI with trends, comparisons, export.
Where a dedicated tracker costs you:
- Money: $19–$150+/year depending on pick.
- Permissions: Accessibility and Automation, typically.
- Learning curve: a few minutes to set up categorization.
Use it when: You actually care about the data, not just a ballpark. Which, given the overhead of setting any of this up, is probably why you're here.
Don't use it when: Screen Time's rough totals are enough for your use case, or you're philosophically committed to only using tools you built yourself.
Side-by-side summary
| Capability | Screen Time | DIY | Dedicated |
|---|---|---|---|
| Per-app time | Yes | Yes | Yes |
| Activity-based idle | No | Possible, manual | Yes |
| URL tracking (all browsers) | No (Safari only) | Possible, manual | Yes |
| Custom categorization | No | Yes (you code it) | Yes |
| Focus score / session length | No | No (you'd build it) | Yes |
| Export | No | Yes | Yes |
| Setup time | 0 min | hours | 5 min |
| Ongoing cost | $0 | $0 | $19 (one-time) or subscription |
| UI / reports | Basic | None (you build it) | Yes |
How to pick
If you're answering "what should I use to track app usage on Mac?" right now and you don't already have a tool in mind:
- Just want the ballpark for today? Open Screen Time. Close it. Move on.
- Want to learn how macOS's activity tracking internals work, or want total control? Install Hammerspoon and write a script. Factor in a weekend.
- Want the data useful for actual focus decisions, today, without writing code? Install Focus Meter. Five minutes of setup. $19. On-device.
The correct answer depends on whether you want to answer a question or build a system. Screen Time and a dedicated tracker answer the question. DIY builds a system. All three are legitimate uses of your time.
