/usr/sbin/uninstall? What is it/what does it do?

Solution 1:

0942v8653's guess is right, /usr/sbin/uninstall is a command line uninstaller for Mac App Store apps.

The file URL must be specified as parameter. In my tests the path to the application did it:

$ sudo /usr/sbin/uninstall /Applications/Reeder.app
Preparing Uninstall...
Uninstall Began...
7%...
15%...
(...)
92%...
100%...
Uninstall Ended...

while non-Mac App Store apps couldn't be uninstalled:

$ sudo /usr/sbin/uninstall /Applications/Seashore.app 
URL is not uninstallable: /Applications/Seashore.app

Interestingly, although I ran the command with sudo it still asked me for administrator credentials:

enter image description here

/usr/bin/uninstall uses the Uninstall private framework:

$ otool -L /usr/sbin/uninstall 
/usr/sbin/uninstall:
(...)
    /System/Library/PrivateFrameworks/Uninstall.framework/Versions/A/Uninstall (compatibility version 1.0.0, current version 202.0.0)
(...)

just like the Dock:

$ otool -L /System/Library/CoreServices/Dock.app/Contents/MacOS/Dock | grep Uninstall
    /System/Library/PrivateFrameworks/Uninstall.framework/Versions/A/Uninstall (compatibility version 1.0.0, current version 202.0.0)

That makes sense, because my tests showed that when an application is uninstalled inside Launchpad (by clicking the app’s delete button that appears when icons wiggle) uninstall is not used, but the Dock.