These utilities list app locations in macOS
The Swift (68.2 ms
) and Objective-C (78.4 ms
) implementations try to mimic
mdfind
's (29.1 ms
) behavior, but run slower than it.
Note
This utility is only intended to run in macOS.
When you are building [applist
], ensure you have either:
- A Swift compiler
- An Objective-C compiler.
If you have brew
installed, just run:
$ brew install Neved4/tap/applist
Otherwise, first clone the repo:
$ git clone https://github.com/Neved4/applist
To build all variants, go to the project directory and run:
$ make all
Alternatively, to build the Objective-C version run:
$ clang -framework Cocoa -o applist-objc applist.mm
For the Swift version, run:
$ swiftc -O applist.swift -o applist-swift
Done!
Alternatively, if you'd rather not install or compile anything, feel free to
add it as a function to your shell .profile
:
applist() {
mdfind "kMDItemContentType == 'com.apple.application-bundle'"
}
$ applist | grep "Docker.app"
/Applications/Docker.app
This comes handy for manual Homebrew reinstalls that lie outside the default install path:
$ brew reinstall --cask docker --applist $(applist | grep Docker)
All programs were benchmarked with hyperfine
under arm64
:
Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
---|---|---|---|---|
applist-sh |
29.1 ± 1.7 | 27.2 | 33.7 | 1.00 |
applist-objc |
68.2 ± 3.5 | 63.7 | 81.5 | 2.34 ± 0.18 |
applist-swift |
78.4 ± 4.2 | 71.0 | 89.9 | 2.69 ± 0.21 |
For other shell functions like applist
, check out apputils.
applist
is licensed under the terms of the MIT License.
See the LICENSE file for details.