Recently, I found myself in a situation… After uninstalling an application from my Macbook Pro, its icon was still visible in the Launchpad. Clicking the icon would do nothing.
How do you get rid of orphaned Launchpad icons? Thanks to Google and Stack Overflow, I discovered that Launchpad icons are stored in a SQLite database in /private/var/folders
with
com.apple.dock.launchpad
in the name. The find
command is useful:
sudo find /private/var/folders -name com.apple.dock.launchpad
finds the directory /private/var/folders/m4/hh39vth91396mblmwt46crkw0000gn/0/com.apple.dock.launchpad
. A little poking around with ls reveals that the database itself is db/db
.
ls -l /private/var/folders/m4/hh39vth91396mblmwt46crkw0000gn/0/com.apple.dock.launchpad/db total 22656 -rw-r--r-- 1 shanglin staff 7495680 Dec 1 10:26 db -rw-r--r-- 1 shanglin staff 32768 Nov 29 00:27 db-shm -rw-r--r-- 1 shanglin staff 2290752 Dec 3 22:05 db-wal
Let’s use sqlite3 to see what’s in the database:
sudo sqlite3 /private/var/folders/m4/hh39vth91396mblmwt46crkw0000gn/0/com.apple.dock.launchpad/db/db sqlite> .tables app_sources dbinfo image_cache widgets apps downloading_apps items categories groups widget_sources sqlite> .schema apps CREATE TABLE apps (item_id INTEGER PRIMARY KEY, title VARCHAR, bundleid VARCHAR, storeid VARCHAR,category_id INTEGER, moddate REAL, bookmark BLOB);
The rogue app had the name “Spelunky” in it. We can use a SQL wildcard to find apps with the word “Spelunky” in the title:
sqlite> select * from apps where title like '%Spelunky%'; <p class="p1">92|Spelunky HTML5|com.google.Chrome.app.Default-mhagnkphcmpkmabhocgimoncfaihkpof|||519537375.0|book
Let’s delete Spelunky’s entry:
sqlite> delete from apps where title='Spelunky HTML5';
After exiting the sqlite shell, I restarted the dock:
killall Dock
and the Spelunky icon was gone. Success!