However, in the process of working out how to remove applications that were not installed through iTunes (I have no intention of putting my credit card details into a laptop I don't own, or to Apple), most of my applications were installed via brew.
I had the following shell script to install, search or delete my applications;
#!/bin/bash
if (( $# < 2 ))
then
echo "SYNTAX: $0 action package" >&2
echo "Where action is one of (search|install|uninstall)" >&2
exit 1
fi
action=$1
shift
package="$@"
case $action in
'install')
brew cask $action $package --force
;;
remove|erase)
brew cask uninstall $package
;;
*)
brew cask $action $package
;;
esac
So when coming to delete the applications were not always easy to remove with brew, as some were downloaded over the Internet.
So if brew odes not remove the application you can try one of the following 3 options;
- The simple method of clicking on Launchpad and then click and hold on the application to remove. All the icons will then wobble. If you can remove the application here then an X will appear against the application. Clicking it will allow you to remove it.
- Open the application. Then bring up the menu for the application in the dock so that you can "show in finder". Then quit the application (don't just close, you need to quit it) and then drag the .app from Finder into the waste basket and then empty trash.
- This final one will help remove application Icons where the application has gone, but the icon refuses to budge from Launchpad. The following describes how to do this.
To remove an icon or application still showing in Launchpad that could not be remove using steps 1 or 2 do the following;
1. To find the application and see if it is in Launchpad run the following command
for x in $(find /private/var/folders -name *launchpad*)
do
sqlite3 $x/db/db "SELECT * FROM apps;"
done | grep -i appName
2. In the 2nd column is the title. This next command requires you to type the title in in the exact case. So if for example you have an application called Thunderbird you would delete it as follows;
for x in $(find /private/var/folders -name *launchpad*)
do
sqlite3 $x/db/db "DELETE FROM apps WHERE title='Thunderbird';"
done
Replacing Thunderbird with the title you got from Step 1.
Your launchpad will now start to look cleaner.