Force removal of invalid icons in mac launchpad

After mac deletes the application in the application, the residual icon in the launch pad cannot be deleted.
Here's how to delete invalid icons in Launchpad:

first step:

cd /private/var/folders

insert image description here

Step 2: Find the directory where the launchpad is located, and use the file name to find the folder

sudo find ./ -name com.apple.dock.launchpad

insert image description here

Step 3: After finding the relative path, enter the folder and open the db file inside
insert image description here

cd .//81/hf5fsg250kxgb4dn9zjf51w80000gn/0/com.apple.dock.launchpad
cd db

Step 4: Delete the icon entry you want to delete in sqlite3

sqlite3 db "delete from apps where title like 'Windows 10 -2 Applications%';"&&killall Dock

Note: The previous command is to delete everything related to Windows 10 -2 Applications. If you want to delete only what you want to delete, execute the next command

sqlite3 db "delete from apps where title like '图标名';"&&killall Dock

After this method is executed, the order of icons in the launchpad may be different after each restart of the computer. A complete solution has not been found yet.
Found a way to reset the launchpad (Launchpad):
rm ~/Library/Application\ Support/Dock/*.db && killall Dock (used to reset the Dock icon database: will be accompanied by a reset of all desktop backgrounds)
defaults write com. apple.dock ResetLaunchPad -bool true && killall Dock (used to reset the Launchpad icon database)

But after this method is executed, 1. The desktop needs to be reset; 2. The undeletable icons left in the startup platform will come out again. Entered an endless loop.

There is no other way at present, if anyone has a complete solution, you can post @ me.

Reference link:
https://blog.csdn.net/weixin_48300785/article/details/120740513

Guess you like

Origin blog.csdn.net/weixin_48161908/article/details/125911621