mas-cli / mas

:package: Mac App Store command line interface
MIT License
10.81k stars 272 forks source link

`list` does not display some installed apps #256

Open nhurden opened 4 years ago

nhurden commented 4 years ago

Your Environment

Describe the Bug

After successfully installing DaisyDisk (411643860) or Paw (584653203), neither appears in the output of mas list. Subsequently brew bundle always reinstalls these even though there is no need to.

To Reproduce

Steps to reproduce the behavior:

  1. Run mas install 411643860
  2. Run mas install 584653203
  3. Run mas list

Expected Behavior

Output of mas list contains DaisyDisk and Paw.

Actual Behavior

Output of mas list is:

904280696 Things (3.11)
425264550 Disk Speed Test (3.2)
409183694 Keynote (9.2.1)
405399194 Kindle (1.26.1)
1116599239 NordVPN IKE (5.2.0)
1287445660 Agenda (9.1.2)
585829637 Todoist (7.2.3)
682658836 GarageBand (10.3.4)
425424353 The Unarchiver (4.1.0)
880001334 Reeder (3.2.3)
409203825 Numbers (6.2.1)
497799835 Xcode (11.3)
409201541 Pages (8.2.1)
408981434 iMovie (10.1.14)
588726889 ReadKit (2.6.3)
1176895641 Spark (2.5.1)
634148309 Logic Pro X (10.4.8)
924726344 Deliveries (3.2.1)
403489261 LittleSnapper (1.8.5)

which doesn't include the two applications just installed.

Additional Context

I'm also using homebrew-bundle with the following mas entries:

mas "Agenda", id: 1287445660
mas "Blackmagic Disk Speed Test", id: 425264550
mas "DaisyDisk", id: 411643860
mas "Deliveries", id: 924726344
mas "Kindle", id: 405399194
mas "NordVPN IKE", id: 1116599239
mas "Numbers", id: 409203825
mas "Pages", id: 409201541
mas "Paw", id: 584653203
mas "ReadKit", id: 588726889
mas "Reeder", id: 880001334
mas "Spark", id: 1176895641
mas "Things3", id: 904280696
mas "Xcode", id: 497799835

mas reset doesn't appear to help.

malob commented 4 years ago

I was having the same issue for DaisyDisk, Keynote, MindNode, Numbers, Pages, and Pixelmator. I managed to resolve it by uninstalling the apps in question using LaunchPad, then running brew bundle to reinstall them.

(I'm on macOS 10.15.2)

phatblat commented 4 years ago

@nhurden can you check to see whether this issue was resolved in mas 1.6.4? I use both of these apps and get DaisyDisk in the output of mas list:

411643860 DaisyDisk (4.10)

As for Paw, it looks like the old version has been removed from the App Store. So, if you are still using v2, the App Store doesn't know about it anymore. v3 is distributed through paw.cloud, probably because they use their own cloud solution instead of iCloud.

nhurden commented 4 years ago

I've updated to mas 1.6.4 and macOS 10.15.4 and the issue persists.

I've also tried manually uninstalling DaisyDisk via both the Finder and Launchpad followed by re-installing using mas, but DaisyDisk still doesn't appear in the output of mas list.

nhurden commented 4 years ago

Which also means that this is possible:

❯ mas install 411643860 && mas uninstall 411643860
==> Downloading DaisyDisk
==> Installed DaisyDisk
Error: Not installed
pridkett commented 4 years ago

I was having the same issues with Pixelmator and Quiver. I "fixed" it by uninstalling the apps from launchpad and then installing them through MAS.

$ mas install 407963104 && echo && mas uninstall 407963104
==> Downloading Pixelmator
==> Installed Pixelmator

Error: Not installed

Now they seem to work fine..

malob commented 4 years ago

Just and update that I had this same issue again with Slack.

phatblat commented 4 years ago

Digging into this issue again and I'm not able to reproduce the issue with the list command, but there's certainly something odd going on here.

Testing with the Slack app which I already had installed on this Mac, it showed in the list output but showed as "Not installed" when I ran the uninstall command.

↪ mas list
803453959  Slack                      (4.8.0)
...
↪ sudo mas uninstall 803453959
Password:
Error: Not installed

Manually uninstalled Slack using macOS Launchpad.

↪ mas install 803453959
==> Downloading Slack
==> Installed Slack
↪ mas list
803453959  Slack                      (4.8.0)
...
↪ sudo mas uninstall 803453959
==> App moved to trash: /private/var/root/.Trash/Slack.app

Uninstall worked the 2nd time.

malob commented 3 years ago

Just an update that I had this same issue again with 1Password. Would love to know what's causing this.

mattsmitton commented 1 week ago

I also see this behavior with HPE Virtual Intranet (VIA) (id: 1439900554)

rgoldberg commented 5 days ago

@mattsmitton What is the path to the application on the file system? The normal location is in the /Applications folder. If it isn't there, then mas list will not include it. That filter was added because some people had backup copies of apps stored elsewhere on their file system, which were being included in various mas outputs & processing. The requirement for the app to be in /Applications ensured that backup copies elsewhere wouldn't be listed or processed.

If the app is in /Applications, then something else is preventing it from being listed. Unfortunately, the existing app list is provided by undocumented Apple CommerceKit code that doesn't seem to want to be debugged, so it will be difficult to track down the cause. Maybe there's some way to debug the code.

Or maybe we could switch to listing all App-Store apps found under /Applications instead of using & filtering the existing CommerceKit app list. For all apps I've checked,Contents/Info.plist contains both the app name & version, but I've only found the app ID in binary executables for some apps, but not all (just grepping; not sure if there's a tool that can extract the app IDs from executables instead of finding known IDs just by grepping the executables). We'd have to find a reliable way of getting IDs of installed apps, preferably without contacting any Apple or other servers.

What version of mas & of macOS? Are you Apple Silicon or Intel?

What version of HPE Virtual Intranet (VIA) is installed, is latest in the App Store GUI, and is reported by mas info 1439900554?

I see 4.7.0 from the App Store & from mas info 1439900554. It's not installed on my machine.

rgoldberg commented 5 days ago

@mattsmitton Apps from the App Store can be installed from different accounts signed in to the App Store at different times.

mas list only displays apps in the /Applications folder that were installed using the same Apple ID as the Apple ID that is currently associated with your macOS user (via System Preferences/Settings). The Apple ID used in the App Store GUI is set in the App Store GUI, and it looks like mas install installs with the App Store Apple ID, not the macOS Apple ID.

Can you ensure that the Apple ID with which you "purchased" the app that mas isn't listing is the same Apple ID that is associated with your macOS user?

The simplest way to do that would be to uninstall the app (probably should drag its directory to the trash can), then to open the App Store GUI, ensure that you're logged in there with the same Apple ID as you're using for your macOS user, then install the app from the App Store GUI.

Once the correct Apple ID has been ensured, could you then see if the app now is displayed by mas list?