mas: High Sierra Exception error

I’ve just updated to High Sierra, reinstalling my iMac. When i try to sign with mas, i get the following error:

$ /opt/mas signin bob@example.fr 123456789
==> Signing in to Apple ID: bob@example.fr
2017-09-29 08:02:23.950 mas[357:3668] -[__NSXPCInterfaceProxy_ISAccountService signInWithContext:replyBlock:]: unrecognized selector sent to instance 0x7f888f50afa0
2017-09-29 08:02:23.951 mas[357:3668] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSXPCInterfaceProxy_ISAccountService signInWithContext:replyBlock:]: unrecognized selector sent to instance 0x7f888f50afa0'
*** First throw call stack:
(
        0   CoreFoundation                      0x00007fff3f6090fb __exceptionPreprocess + 171
        1   libobjc.A.dylib                     0x00007fff65ef7c76 objc_exception_throw + 48
        2   CoreFoundation                      0x00007fff3f6a1c34 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
        3   CoreFoundation                      0x00007fff3f57f510 ___forwarding___ + 1456
        4   CoreFoundation                      0x00007fff3f57eed8 _CF_forwarding_prep_0 + 120
        5   mas                                 0x00000001086d0779 mas + 141177
        6   mas                                 0x00000001086d00f8 mas + 139512
        7   mas                                 0x00000001086e9fa0 mas + 245664
        8   mas                                 0x00000001086e9720 mas + 243488
        9   mas                                 0x00000001086be4b8 mas + 66744
        10  mas                                 0x00000001086c1ac8 mas + 80584
        11  mas                                 0x00000001086bf072 mas + 69746
        12  mas                                 0x00000001086bf542 mas + 70978
        13  mas                                 0x00000001086bf367 mas + 70503
        14  mas                                 0x00000001086d1c70 mas + 146544
        15  libdyld.dylib                       0x00007fff66ae6145 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Abort trap: 6

iMac 14,1 High Sierra 10.13 Mas version 1.3.1

Thank you

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 12
  • Comments: 20 (3 by maintainers)

Commits related to this issue

Most upvoted comments

Thanks for the updates and details, everyone. Sorry it has been broken for so long, but I’m looking into this now.

It appears that the private API mas was using has changed and -signinWithContext:replyBlock: was removed. I’m researching this now but the fix is going to be a bit tricky in order to maintain support for older OSes.

On 10.14 Mojave signing in to the App Store does not seem to help. I’ve done that but mas account still reports “Not signed in”

A workaround I am using until this is fixed:

loginToAppStore () {
  echo -e "\nPlease log in to the app store..."

  open -a "/Applications/App Store.app"

  until (mas account > /dev/null);
  do
    sleep 3
  done
}

Apparently, the signin command was added by this commit :

https://github.com/mas-cli/mas/commit/d80ad6e866378504c11aeb2e47692977954bd05d

This uses a tool call class-dump to dump private headers which can then be used to interact with AppStore.

As this uses unsupported private headers, it might break for any macOS release.