sodcalculator

10 Tech How-To

macOS App Library Paths: Find and Fix Absolute

Guide 10-47885 · Updated · Step by step

If you’re seeing errors like “file not found” or “application cannot be opened” because an app is looking for a file at an absolute path that no longer exists, the fix is to update or replace that hard-coded path. This guide shows you where macOS stores app library paths, how to find them, and how to correct absolute path references that break after moving or renaming files.

What Are App Library Paths?

macOS apps often store support files, caches, preferences, and user data in specific folders called “Library” directories. These are not the same as the app bundle itself (the .app file). There are three main Library locations:

  • System-wide: /Library – used for all users, requires admin privileges.
  • User-specific: ~/Library – per-user app data, preferences, and caches.
  • Local (legacy): /Library under the root user’s home – rarely used today.

An absolute path is a full path starting from the root directory, like /Users/john/Library/Application Support/MyApp/config.plist. When an app is moved, or a user directory is renamed, these absolute paths break because the app still expects the old location.

Why Absolute Paths Break

Most modern macOS apps use relative paths or system APIs like FileManager.default.urls(for:in:) to locate Library folders. However, some older apps, command-line tools, or scripts hard-code absolute paths. Common causes of breakage:

  • Moving the app bundle to a different folder (e.g., from Downloads to /Applications).
  • Renaming the home directory or username (which changes /Users/oldname to /Users/newname).
  • Restoring from a backup where the original path was different.
  • Using symlinks that point to a non-existent target.

When an absolute path breaks, the app may crash, fail to save preferences, or show a dialog about missing files.

How to Find an App’s Library Path

To locate the exact absolute path an app is using, you can use several methods:

  1. Check the app’s own settings: Many apps, especially developer tools, show a “Data Directory” or “Library Path” in Preferences.
  2. Use Terminal: Run find ~/Library -iname "*appname*" to list matching files and folders.
  3. Inspect the app bundle: Right-click the app, select “Show Package Contents,” and look inside Contents/ for a Info.plist that may contain a LSApplicationCategoryType or a custom key with a path.
  4. Monitor file activity: Use fs_usage or lsof in Terminal while launching the app to see which paths it tries to access.

For example, to see all open files by an app, run lsof -c AppName (replace AppName with the process name).

How to Fix an Absolute Path

Once you’ve identified the broken absolute path, you have several options:

  • Recreate the folder: If the app expects a directory that was deleted, simply create it again with mkdir -p /path/to/folder.
  • Move the file back: If you moved the file, put it back to the original absolute path.
  • Use a symlink: If you want to keep the file elsewhere, create a symbolic link: ln -s /actual/location /expected/location.
  • Update the app’s configuration: Some apps store their path in a plist file (e.g., ~/Library/Preferences/com.example.app.plist). Edit that file with defaults write or a plist editor.
  • Reinstall the app: If nothing else works, reinstalling may reset the path to the current location.

For example, if an app expects a file at /Users/john/Library/Application Support/MyApp/config.json but the user directory was renamed to johnny, you can run:

sudo ln -s /Users/johnny/Library/Application\ Support/MyApp /Users/john/Library/Application\ Support/MyApp

This creates a symlink that makes the old path work again.

Common Problems and Misconceptions

One common misconception is that macOS automatically updates all absolute paths when you move an app. This is not true; only apps that use relative paths or dynamic APIs are safe. Another issue is that ~/Library is hidden by default in Finder, so users may not see it. To reveal it, open Finder and press Cmd+Shift+H to go to your home folder, then press Cmd+Shift+. to show hidden files.

Another frequent problem is that editing a plist file incorrectly can cause the app to crash. Always back up the plist before editing. Additionally, some apps store paths in a database (like SQLite) rather than a simple plist, making manual edits more complex.

Using Terminal to Find and Fix Paths

Terminal is the most direct way to find and fix absolute paths. Useful commands:

  • echo $HOME – shows your home directory path.
  • find / -name "filename" 2>/dev/null – search the whole system for a file (may take time).
  • grep -r "oldpath" /path/to/config 2>/dev/null – search for a string inside files.
  • defaults read com.example.app – read an app’s preferences.
  • defaults write com.example.app key -string "/new/path" – write a new string value.

For example, if an app stores its data path in a preference key called DataPath, you can change it with:

defaults write com.example.app DataPath -string "/Users/johnny/Library/Application Support/MyApp"

Remember to restart the app after making changes.

Safety and Precautions

Editing Library folders and plists can be risky. Always back up the files you modify. Avoid changing system-wide /Library unless you’re sure what you’re doing, as it can affect other users. Use sudo only when necessary, and be careful with symlinks – a broken symlink can cause more errors than it fixes.

If an app is from the Mac App Store, consider deleting and reinstalling it instead of manually editing paths, as the system may manage paths automatically.

Frequently Asked Questions

How do I show the Library folder in Finder?

Open Finder, go to your home folder (Cmd+Shift+H), then press Cmd+Shift+. (period) to toggle hidden files. Alternatively, in Finder’s “Go” menu, hold down the Option key to reveal “Library” in the dropdown.

What’s the difference between ~/Library and /Library?

~/Library is per-user and contains your preferences, caches, and app data. /Library is system-wide and contains items like printer drivers and shared application support. Most app data is in ~/Library.

Can I move an app’s Library folder to another drive?

Yes, but you must create a symlink from the original location to the new one, and the new drive must be available at login. Some apps may not support this, especially if they use low-level file access.

Why does my app still crash after I fixed the path?

There may be multiple path references, or the app may cache the old path. Try restarting the app, clearing its cache (usually in ~/Library/Caches), or rebooting. If the problem persists, check for another config file or use fs_usage to see what paths the app is trying to access.

Is it safe to delete files in ~/Library?

Generally, deleting files in ~/Library can break apps. Only delete caches (which can be regenerated) or preferences for apps you no longer use. Always back up first.

How do I find all absolute paths in a plist?

Use plutil -p /path/to/file.plist to print the contents, then look for strings starting with /. You can also use grep on the plist’s XML version.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →