8000 `mas list` display NO applications · Issue #805 · mas-cli/mas · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

mas list display NO applications #805

New issue

Have a 8000 question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
antoine2711 opened this issue Apr 24, 2025 · 12 comments
Closed

mas list display NO applications #805

antoine2711 opened this issue Apr 24, 2025 · 12 comments
Assignees
Labels
🧽 chore Administrative task: documentation, build, test, release, git, etc.
Milestone

Comments

@antoine2711
Copy link

mas config

mas ▁▁▁▁ 2.1.0
arch ▁▁▁ x86_64
from ▁▁▁ homebrew/core/mas
origin ▁ https://github.com/mas-cli/mas.git
rev ▁▁▁▁ a4756e8c82a2bae5d5de1b137ec16fa7c1df8c94
driver ▁ 1.115.1
swift ▁▁ 6.0.3 (swiftlang-6.0.3.1.10 clang-1600.0.30.1)
region ▁ CA
macos ▁▁ 14.7.5 (23H527)
mac ▁▁▁▁ Macmini8,1
cpu ▁▁▁▁ Intel(R) Core(TM) i7-8700B CPU @ 3.20GHz

Installation method

Homebrew core (via brew install mas)

Bug description

Can’t see any application installed.

Steps to reproduce

mas list
@rgoldberg
Copy link
Contributor
rgoldberg commented Apr 24, 2025

@antoine2711 This is likely a duplicate of #801. If it is a duplicate, it isn't a bug per se, though mas could warn about and/or attempt to mitigate the circumstances.

Below is the existing proposed new addition for the README.md from PR #803.

Please let me know if it solves your problem. If so, please let me know if you would like to see any changes in the proposed new documentation.

If it is the problem, I can see if there is any way to easily check from Swift if Spotlight has indexed your apps, then, if they haven't already been indexed, to start the indexing and/or output a warning.

If not, please let me know the output of the various commands that you try.

Proposed new documentation below

mas list returns no results

mas 2.0.0+ sources data for installed MAS apps from masOS's Spotlight metadata store.

mas can only interact with MAS apps if they have been indexed by the Spotlight Metadata Server
(aka MDS) background processes.

You can check if an MAS app has been indexed in the metadata store by running:

## General format:
$ mdls -rn kMDItemAppStoreAdamID /path/to/app
## Outputs nothing if the app is not indexed
## Outputs the app ID if the app is indexed

## Example:
$ mdls -rn kMDItemAppStoreAdamID /Applications/WhatsApp.app
310633997

If an app has been indexed in the metadata store, given its app ID, you can find the path to the
app by running:

$ mdfind 'kMDItemAppStoreAdamID == 310633997'
/Applications/WhatsApp.app

If any of your MAS apps are not indexed, you can enable/rebuild the metadata store for all file
system volumes by running:

sudo mdutil -Eai on

@antoine2711
Copy link
Author
antoine2711 commented Apr 24, 2025

Hum. I think it fixed it. I now see back all my apps.

I did run:
sudo mdutil -Eai on

Thanks. Regards, Antoine

@rgoldberg rgoldberg self-assigned this Apr 24, 2025
@rgoldberg rgoldberg added this to the 2.2.0 milestone Apr 24, 2025
@rgoldberg
Copy link
Contributor
rgoldberg commented Apr 24, 2025

@antoine2711 Thanks. Glad it works now.

Was the documentation good? Should it be changed in any way?

I will look into automatically starting Metadata Server indexing from Swift.

@rgoldberg rgoldberg added 🧽 chore Administrative task: documentation, build, test, release, git, etc. and removed 🐛 bug labels Apr 24, 2025
@martimlobao
Copy link
martimlobao commented Apr 24, 2025

I just upgraded to macOS 15.4.1 and mas list also broke for me. Attempting to run sudo mdutil -Eai on to see if it resolves the issue. If so, would it be possible to add this in the error message as a suggested fix if the user believes the error shouldn't be happening?

Edit: Hmm, sudo mdutil -Eai on didn't resolve the issue for me, nor did running sudo mdutil -Eai off first and then on.

~
❯ mas list
Error: No installed apps found

~
❯ sudo mdutil -Eai off

~ as 🧙 took 11s
❯ mas list
Error: No installed apps found

~ as 🧙
❯ sudo mdutil -Eai on

~ as 🧙 took 10s
❯ mas list
Error: No installed apps found

@rgoldberg
Copy link
Contributor

@martimlobao please provide the output of mas config. If you aren't running the newest mas (currently 2.1.0), can you please upgrade?

@martimlobao
Copy link

@rgoldberg running the latest version:

❯ mas config
mas ▁▁▁▁ 2.1.0
arch ▁▁▁ arm64
from ▁▁▁ homebrew/core/mas
origin ▁ https://github.com/mas-cli/mas.git
rev ▁▁▁▁ a4756e8c82a2bae5d5de1b137ec16fa7c1df8c94
driver ▁ 1.115.1
swift ▁▁ 6.0.3 (swiftlang-6.0.3.1.10 clang-1600.0.30.1)
region ▁ US
macos ▁▁ 15.4.1 (24E263)
mac ▁▁▁▁ MacBookPro18,3
cpu ▁▁▁▁ Apple M1 Pro

It might just be a transient error, I'll reboot later today and try again.

@rgoldberg
Copy link
Contributor

@martimlobao thanks for the info.

If restarting doesn't fix things, can you try the various diagnostic commands mentioned in the proposed documentation?

@antoine2711
Copy link
Author

@antoine2711 Thanks. Glad it works now.

And thank you very much for your support @rgoldberg. That fixed my problem.

Was the documentation good? Should it be changed in any way?

I would say yes, since I assumed that my indexation was problematic, [re]indexing by running sudo mdutil -Eai on fixed it all. And it was easy for me to spot that in your instructions.

I didn't check to see first if for some reasons, indexing was off, nor did I check any app before to see if they weren't indexed.

I will look into automatically starting Metadata Server indexing from Swift.

I think this would fix future problems for people, since it seems it was my problem.
It woudl save you precious time to read user's questionning.

Best Regards, Antoine

@antoine2711
Copy link
Author

@rgoldberg : sorry, I closed this issue, but I see it's now a task. My mistake. Can't reopen it, though.

Regards, Antoine

@rgoldberg
Copy link
Contributor

@antoine2711 No problem about closing. Also waiting to hear back from @martimlobao, but would eventually close anyway as I can track work in the original issue.

I might output Spotlight indexing instructions to stderr if mas list doesn't find apps. See #803 (comment). Might be in addition to, or instead of, docs in README.md.

@martimlobao
Copy link

@rgoldberg
Alas still not working after a reboot.

I was going to say it didn't work (toggled off and on and still gave an error), but after waiting a minute and using the diagnostic command, I'm happy to say that it's working now :) Maybe it takes a little while to rebuild the index?

~
❯ mas list
Error: No installed apps found

~
❯ sudo mdutil -Eai off
/:
2025-04-24 21:00:49.217 mdutil[2170:15818] mdutil disabling Spotlight: / -> kMDConfigSearchLevelFSSearchOnly
        Indexing disabled.
/System/Volumes/Data:
2025-04-24 21:00:49.465 mdutil[2170:15818] mdutil disabling Spotlight: /System/Volumes/Data -> kMDConfigSearchLevelFSSearchOnly
        Indexing disabled.
/System/Volumes/Preboot:
2025-04-24 21:00:50.130 mdutil[2170:15818] mdutil disabling Spotlight: /System/Volumes/Preboot -> kMDConfigSearchLevelFSSearchOnly
        Indexing disabled.

~ as 🧙 took 4s
❯ sudo mdutil -Eai on
/:
        Indexing enabled.
/System/Volumes/Data:
        Indexing enabled.
/System/Volumes/Preboot:
        Indexing enabled.

~ as 🧙
❯ mas list
Error: No installed apps found

~ as 🧙
❯ mdls -rn kMDItemAppStoreAdamID /Applications/Numbers.app
409203825%
~ as 🧙
❯ mas list
937984704   Amphetamine          (5.3.2)
1193539993  Brother iPrint&Scan  (12.2.1)
409203825   Numbers              (14.4)

@rgoldberg
Copy link
Contributor

@martimlobao Glad it's working now. Thanks for testing it.

I think we can track the work to document the fix / mitigate the problem in the other open issues / PRs about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧽 chore Administrative task: documentation, build, test, release, git, etc.
Projects
None yet
Development

No branches or pull requests

3 participants
0