Basically, we can remove the icon of an application by just uninstalling it. But sometimes things would become a little complicated.
For example, I might have once installed chrome onto my Mac long time ago and then uninstalled it. (Maybe some other pattern, I’ve forgotten.) And now I installed it again, but I noticed that there is an extra icon for each chrome app such as Gmail, Google Search and Google Drive. I went to chrome://apps and removed everything from my chrome and one icon for each of that app has gone with the extra ones still there. So I believe the extra icons were there since my first installation of chrome.
In order to send them away, I tried some tricks that mentioned in internet but none of them worked. But I found that the files related to dock and launchpad are always with extension named “.db”. That means the information of the launchpad is stored in a database file which also means that we should be able to modify or even delete entries directly in that database file with a database management application.
Keeping searching in the internet, I found the location of launchpad’s database and the command to modify it, finally. That command is as below.
sqlite3 $(sudo find /private/var/folders -name com.apple.dock.launchpad)/db/db "DELETE FROM apps WHERE title='APP_NAME_CASE_SENSITIVE';" && killall Dock
This command uses sqlite3 to find that database file at /private/var/folders and modify it with a SQL command. Then kills the dock. After executing that in terminal and waiting for a second so that the dock will restart automatically, I opened the launchpad and the annoying icon is gone.
However, according to the person who provided this command, it seems that this is only available if you are using the Yosemite.
Hope that the article will help more people who are suffering with the same problem.