Find if an application is from the Mac App Store

Jul 31, '12 07:30:00AM

Contributed by: kirkmc

I was rooting around my system today, and wondering if there's any way to find out if an application is from the Mac App Store. The Info window - when you select an item and press Command-I - doesn't say anything, but the System Information application does. There is an "App Store" column which says yes or no for each application.

I figured there had to be another way, and eventually found that the mdls command gives some of this information. Running mdls <app name> returns a lot of information, but near the top of the list are a few lines like this:

$ mdls /Applications/Smarts.app 
kMDItemAlternateNames             = (
    "Smarts.app"
)
kMDItemAppStoreAdamID             = "438671026"
kMDItemAppStoreCategory           = "Music"
kMDItemAppStoreCategoryType       = "public.app-category.music"
kMDItemAppStoreHasReceipt         = 1
kMDItemAppStoreInstallerVersionID = "8330689"
kMDItemAppStoreIsAppleSigned      = 1
kMDItemAppStorePurchaseDate       = 2012-06-13 07:14:43 +0000
kMDItemAppStoreReceiptType        = "ProductionReceipt"

The kMDItemAppStoreHasReceipt is what says whether or not it is a Mac App Store application, but you can see some other Mac App Store information there, such as the category (non-MAS apps have this too, interestingly), the purchase date, the application's ID, etc.

My interest in this is purely academic, but it could be useful to find all Mac App Store applications on a given Mac; you could use the kMDItemAppStoreHasReceipt key in a search, for example. If you run this in Terminal, you'll get a list of all your Mac App Store applications:

mdfind "kMDItemAppStoreHasReceipt=1"

Note that if you have any volumes excluded from Spotlight searches, their Mac App Store apps won't be listed in the results. (H/t to Thomas for that command.)

If anyone has any other ways of finding this information, feel free to post them in the comments.

Comments (9)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20120731002309128