# Debugging macOS LaunchAgent Failures With launchctl and Exit Code 78

DevFeed: [Debugging macOS LaunchAgent Failures With launchctl and Exit Code 78](<https://devfeed.tech/articles/debugging-macos-launchagent-failures-with-launchctl-and-exit-code-78-119758.md>)

Original publisher: [Read original article](<https://hackernoon.com/debugging-macos-launchagent-failures-with-launchctl-and-exit-code-78?source=rss>)

Author: Malek Damiri

Published: 2026-11-05T17:26:33Z

Content type: tutorial

Language: en

Sources: [HackerNoon](<https://devfeed.tech/sources/hackernoon.md>)

Topics: [macOS](<https://devfeed.tech/topics/macos.md>), [plist](<https://devfeed.tech/topics/plist.md>)

Tags: [debugging](<https://devfeed.tech/tags/debugging.md>), [diagnose](<https://devfeed.tech/tags/diagnose.md>), [exit-code-78](<https://devfeed.tech/tags/exit-code-78.md>), [launchagent-monitoring](<https://devfeed.tech/tags/launchagent-monitoring.md>), [launchctl](<https://devfeed.tech/tags/launchctl.md>), [launchd](<https://devfeed.tech/tags/launchd.md>), [macos](<https://devfeed.tech/tags/macos.md>), [macos-automation](<https://devfeed.tech/tags/macos-automation.md>), [macos-debugging](<https://devfeed.tech/tags/macos-debugging.md>), [macos-launchagent](<https://devfeed.tech/tags/macos-launchagent.md>), [macos-scheduled-jobs](<https://devfeed.tech/tags/macos-scheduled-jobs.md>), [monitor](<https://devfeed.tech/tags/monitor.md>), [plist](<https://devfeed.tech/tags/plist.md>), [test](<https://devfeed.tech/tags/test.md>)

## AI overview

An unexpected LaunchAgent exit code 78 (`EX_CONFIG`) usually means launchd failed during setup before the program ran. The article identifies missing executables, nonexistent working directories, and log files launchd cannot open as causes; a missing log folder is created automatically, while a program that runs and fails reports its own exit code. In the author's case, moving logs from the Desktop to `~/Library/Logs` fixed a TCC-related failure, though Desktop access varied with process context. To test quickly, clone the plist under a new label, replace its command with `/usr/bin/true`, enable `RunAtLoad`, bootstrap it, inspect the exit code, then reload the real job after corrections. The included Python checker flags missing paths and log paths in protected folders. For prevention, use absolute interpreter paths, recheck them after upgrades, and have an independent check alert when a job's last success is missing.

## Source excerpt

Learn how to diagnose silent macOS LaunchAgent failures, investigate launchd exit code 78, test plist configurations, and monitor scheduled jobs.