Introduction
macOS relies on the LaunchServices database to track which applications open specific file types and to render the correct icons in Finder and the Dock. When this database becomes corrupted, you may experience generic document icons, duplicate entries in the “Open With” menu, or applications failing to launch. This guide explains how to rebuild the LaunchServices database directly from the Terminal.
When to Rebuild LaunchServices
You should perform this troubleshooting step if you notice:
- Applications displaying a generic white application icon.
- Files showing incorrect or missing thumbnail icons.
- The “Open With” context menu containing greyed-out or duplicate app versions.
- System slowdowns when right-clicking files.
Step 1: Open Terminal
Navigate to Applications > Utilities and launch Terminal, or press Cmd + Space and type Terminal.
Step 2: Execute the Rebuild Command
The lsregister tool is hidden deep within the macOS System framework. To rebuild the database, copy and paste the following command exactly as written. This command forces LaunchServices to unregister and reregister all apps in the System, Local, User, and Network domains.
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user
Press Enter. The process may take several minutes depending on how many applications are installed. Do not interrupt the process; the Terminal prompt will return when it finishes.
Step 3: Restart the Dock and Finder
For the changes to take effect immediately in the GUI, you must restart the Dock and Finder processes. Run the following commands sequentially:
killall Dock
killall Finder
Your screen may briefly flash as these components reload. Once they return, check your application icons and the “Open With” menu. The corrupted entries should now be resolved.