App Store indicates apps as not installed after install or update
Configuration
mas ▁▁▁▁ 4.0.0
arch ▁▁▁ arm64
from ▁▁▁ homebrew/core/mas
origin ▁ https://github.com/mas-cli/mas.git
rev ▁▁▁▁ 21205c013fa941e89463e1d8e553d6e4e3eb8b3f
swift ▁▁ 6.2.1 (swiftlang-6.2.1.4.8 clang-1700.4.4.1)
driver ▁ 1.127.14.1
region ▁ EE
macos ▁▁ 26.2 (25C56)
mac ▁▁▁▁ Mac15,12
cpu ▁▁▁▁ Apple M3
Bug description
Updating apps with 'mas update' causes them to be indicated as not installed (cloud icon instead of Open button in App Store) while app instance is actually updated. If that cloud icon is clicked in this situation (like when normally installing app from App Store) App Store will install duplicate beside already existing app. Output of 'mas update' does not indicate anything abnormal and this can go unnoticed without looking into App Store.
Steps to reproduce
There's no other steps to reproduce than just issuing 'mas update' command when there are outdated apps.
@nmt1900 Please update mas to 4.1.0, which was released earlier today.
Please provide the command-line output of any update that doesn't work as anticipated.
There's at least one issue here, and a probable second one:
- I can successfully update apps using 4.1.0, but their App Store button is a cloud download icon instead of "Open". This might not be able to be fixed, given the workaround for the installd issue from macOS 26.1, 15.7.2 & 14.8.2.
- Try
mas update --accurate-ignore-unknown-appsinstead. Without that flag, mas attempts to update some apps that are actually not outdated. The main reason for that is that the version numbers from 2 different Apple services (which are used for the default outdated check) can be different for the same release of an app. It's stupid, but it is what it is. The 2 new accurate flags forupdate&outdatedperform their outdated checks using only one system in a much more accurate way, but they can cause dialog boxes to appear, might suffer from rate-limiting by Apple, and might have other as-yet-unknown issues.
If you try with & without the aforementioned flag, and provide the outputs here, then I can diagnose everything more easily.
- If this is really the case then it probably is more like "known issue" than bug. Problem here is will app be able to be updated by/from App Store in this state or not? If not then this will force to resort using only mas for updates (?)
- Yes 4.1.0 appeared on Homebrew. Now just have to wait until there is anything else to update to test it more.
@nmt1900 Have you tried mas outdated (without any flags)?
If problem 2 is actually occurring for you, the mas inaccurate outdated app detection logic would still erroneously think that such apps are outdated.
So we can confirm or rule out problem 2 right now without waiting for truly outdated apps.
mas outdated (without any flags) has not prduced any "false positives" so far i.e. if there's any outdated apps then versions of currently installed app and update have been indicated correctly. If there are no outdated apps (as it is now) there is no output.
@nmt1900 I'm sorry, I misread your initial issue; I thought it said that the app wasn't updated, instead of it being updated.
Problem 2 is thus completely unrelated to this issue, while problem 1 is just a restatement of this issue.
Sorry for the confusion.
I'll look into this someday soon, but it might be difficult to find a solution for this, if a solution even exists given the installd workaround.
@alienator88 When mas 4+ uses your installer & mdimport workaround for the macOS 26.1 installd restrictions, the App Store page for each installed/updated app shows the install icon (cloud with a down arrow) instead of the Open button.
I tried updating an app with Pearcleaner instead, which didn't suffer from the same problem.
Did you ever run into this problem? If so, how did you solve it? When I've tried to incorporate the few differences that I've seen between the 2 codebases (besides Pearcleaner using a privileged helper process vs mas using sudo, Pearcleaner being a bundled & signed GUI app & mas being an unsigned, non-bundle command-line tool) into mas, it hasn't helped.
I figured I'd ask you about this before I try code signing, bundling, privileged helper processes, or other large-scale changes.
Thanks for any help.
Hey there!
I had maybe one or two people mention they saw that happen once. But nothing else reported since and I've never been able to reproduce it either.
I haven't added any other steps to the process really.
I wonder if it's some race condition between getting the app installed and the receipt configured with the right permissions and mdimport.
Maybe the system log captured something for these failures?
@alienator88 Thanks for the info. Sorry to bother you during your open source hiatus, but one more question:
I found your comment on a closed Pearcleaner issue where you mentioned that you might have found a fix for the problem that the user experienced in Pearcleaner 5.4.2 (Build 120).
I looked through all the commits after 5.4.2; the only one that I found that seemed like it could fix the issue made this change.
My code already changed the owner:group of the file to 0:0, but still suffers from the issue.
Were you thinking of that change, or of another one, in your aforementioned comment?
I will check my system logs & perform more investigation soon; I'm working on other stuff first.
Thanks for any help. Enjoy your December time off.
No worries!
Yeah that's what "i thought" might've been a cause. I haven't seen other reports since, but it could be a coincidence too.
If I get more on my end I can tag you as well and we can get more eyes on it. Would be nice to get a definitive fix for it.
Thanks again for looking into this. I'll obviously post here if I find an answer or anything else useful.
Enjoy your break!
My latest test on 'mas update' was just to try open app once after 'mas update' without invoking any other commands before that and even this seemed to work - I eopened App Store and cloud+arrow icon was replaced with Open button. All without excessive waiting.
@nmt1900 Opening an app fixes the App Store app page button for me, too. Thanks.
Now must replicate the outcome without owning any GUI apps and/or dialogs.
@alienator88 @HugeIRL does anyone know what opening an app does that can be split off from actually opening the app, so I can try to replicate that in Swift to see if those steps solve the problem?
I'll look into this after I finish some other stuff first.
I don't know fully, no. But opening the app doesn't help for me. I'll continue testing.
It might be a combo of having run certain commands, then afterwards opening the app. Were your most recent tests on macOS 26.2?
I'm not at my computer right now to test, but what might be happening during app open is the lsregister db might be getting resynced.
We could try registering the app URL as well after update and see if it helps.
https://developer.apple.com/documentation/coreservices/1446350-lsregisterurl
@alienator88 LSRegisterURL(…) direct from Swift worked for me. Thanks!
Awesome! Glad to hear it :)
mdimport is still necessary before LSRegisterURL(…).
Good to know, I'll add this to my app as well soon since it's working for you. Thanks for confirming!