mas
mas copied to clipboard
ππ₯π ββοΈ Signin command disabled on macOS 10.13+
As of version 1.4.2 the signin
command has been disabled on newer versions of macOS. This is an interim workaround to the crasher first identified in #107.
mas 1.4.2 was never released through Homebrew, so it must besownloaded and installed manually from the 1.4.2 release or built from source using Xcode.
π Situation
In macOS High Sierra (10.13) Apple removed the -[ISAccountService signInWithContext:replyBlock:]
method from the StoreFoundation private Apple framework which this app relies on to authenticate users through the signin
command. I have done a lot of digging and debugging but have not found another API that works to authenticate a user with the Mac App Store.
Users running older macOS versions (10.9-10.12) are unaffected.
ππ»β¨οΈ Workaround
Sign into the Mac App Store GUI app manually. Once signed in MAS app, the mas command should work fine.
I know this is not an ideal scenario, especially for script automation. Hopefully, I'll find a real solution to this soon.
Please π this issue if you are affected by it.
Related: #107, #129, #147, #155, #159, #160, #162
This impacts me quite a bit as I rely on mas to automate updates on my Mac labs. I'm happy to help look for solutions as I am able. Does anyone have a list of Apple API resources as a start?
Can we open the App Store GUI on 10.13+?
@SConaway the --dialog
option to the signin
command wasn't effective to open the MAS GUI because it would crash before causing the app to launch.
@b3cramer docs for all of Apple's public frameworks is available online, but no docs or developer support is available for private frameworks. If you are interested in perusing these private frameworks, you can use the aging class-dump command to generate headers from the binaries on your mac. I've done this for some versions of macOS in my macOSPrivateFrameworks repo.
I'll prolly do that tomorrow of 10.14. I'll make a PR to you with them.
Well, the signin command isnβt disabled on Mojave and itβs still crashing the same for me.
With Mojave mas
seems to just no-op on commands like outdated
or upgrade
(I can see pending updates in the App Store but mas
doesn't report them). The account
command reports that I am not signed in (I have signed in to App Store), the signin
command produces a large error stack.
Workaround described does not work in Mojave...
@jpartain89 @robfletcher @franklouwers What version of mas were you using? Note that this change was introduced in 1.4.2 which has not been released through Homebrew.
I just tried 1.4.2 and it works.
$ ./mas-1.4.1 signin [email protected]
==> Signing in to Apple ID: [email protected]
Password:
2018-10-02 13:43:20.542 mas-1.4.1[87389:4605362] -[__NSXPCInterfaceProxy_ISAccountService signInWithContext:replyBlock:]: unrecognized selector sent to instance 0x7f849640d210
2018-10-02 13:43:20.543 mas-1.4.1[87389:4605362] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSXPCInterfaceProxy_ISAccountService signInWithContext:replyBlock:]: unrecognized selector sent to instance 0x7f849640d210'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff3bb1d43d __exceptionPreprocess + 256
1 libobjc.A.dylib 0x00007fff67a2e720 objc_exception_throw + 48
2 CoreFoundation 0x00007fff3bb9a255 -[NSObject(NSObject) __retain_OA] + 0
3 CoreFoundation 0x00007fff3babcad0 ___forwarding___ + 1486
4 CoreFoundation 0x00007fff3babc478 _CF_forwarding_prep_0 + 120
5 mas-1.4.1 0x000000010d76d452 mas-1.4.1 + 201810
6 mas-1.4.1 0x000000010d78ab70 mas-1.4.1 + 322416
7 mas-1.4.1 0x000000010d7561e4 mas-1.4.1 + 106980
8 mas-1.4.1 0x000000010d7426fd mas-1.4.1 + 26365
9 mas-1.4.1 0x000000010d742590 mas-1.4.1 + 26000
10 mas-1.4.1 0x000000010d754276 mas-1.4.1 + 98934
11 mas-1.4.1 0x000000010d73f7ef mas-1.4.1 + 14319
12 libdyld.dylib 0x00007fff68afc085 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Abort trap: 6
$ ./mas-1.4.2 signin [email protected]
Error: The 'signin' command has been disabled on this macOS version. Please sign into the Mac App Store app manually.
For more info see: https://github.com/mas-cli/mas/issues/164
There is another problem with 1.4.1 (don't think it was mentioned before) which makes 1.4.1 completely broken on Mojave
$ ./mas-1.4.1 account
Not signed in
Error: Not signed in
./mas-1.4.2 account
[email protected]
@phatblat I'm using 1.4.1 from Homebrew
Is 1.4.2 coming to homebrew or is there a reason it's being held back? Happy to install it another way if so. I use mas
mainly via https://github.com/DanielThomas/oh-your-dotfiles (I added the mas
support to that).
@robfletcher the PR for mas version 1.4.2
was declined. See #174.
Hey, first of all thanks for this project, I really like it.
Regarding the not working install via mas on the command line I came up with a workaround until another solution can be found.
I maintain a github project which aims at automating install, customization and updates of macos. You can find it here: https://github.com/tiiiecherle/osx_install_config
As part of homebrew install scrips I added a bash script that installs mas, opens the appstore via applescript and enters apple-id and password before closing the appstore to automate the complete process. The script prompts you for your credentials to use it later in the appstore. If you want to autmate it completely just export your credentials before running the script. The script can be found here.
~~https://github.com/tiiiecherle/osx_install_config/blob/master/05_homebrew_and_casks/5b_homebrew_cask/6_mas_appstore.sh~~
Link Update due to project restructuring... https://github.com/tiiiecherle/osx_install_config/blob/master/03_homebrew_casks_and_mas/3b_homebrew_casks_and_mas_install/6_mas_appstore.sh
Be sure to download the complete folder 05_homebrew_and_casks and run the script from there without deleting the other scripts as it uses other scripts in the directory to check and define variables and components of the script to avoid redundant code in the other scripts in the same directory.
Hope it helps anyone ;)
any news for 1.4.3?
@hypery2k Yes! Itβs out now on Homebrew. Just landed today
very awesome, seems to work for me. thanks
@phatblat Thanks for the update ;)
@hypery2k What do you mean by working for you? Signin is still disabled on the command line, isn`t it?
Still disabled.
@jem-swu yep. Signin will stay disabled to avoid the crash until there is a fix for this issue
@phatblat ok, thanks for the heads-up. I updated the automatic login by applescript around two weeks ago. Worked fine while testing...
see https://github.com/mas-cli/mas/issues/164#issuecomment-427061409
Not sure why, but even running
-
mas signout
- Sign in using
App Store.app
-
mas search Xcode
returns empty results
mas install
seems to work well now, while mas search
and mas lucky
didnβt work yet.
ε¨ 2018εΉ΄10ζ30ζ₯οΌδΈε5:05οΌQuentin Dreyer [email protected] ειοΌ
Not sure why, but even running
mas signout Sign in using App Store.app mas search Xcode returns empty results
β You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
Hey, first of all thanks for this project, I really like it.
Regarding the not working install via mas on the command line I came up with a workaround until another solution can be found.
I maintain a github project which aims at automating install, customization and updates of macos. You can find it here: https://github.com/tiiiecherle/osx_install_config
As part of homebrew install scrips I added a bash script that installs mas, opens the appstore via applescript and enters apple-id and password before closing the appstore to automate the complete process. The script prompts you for your credentials to use it later in the appstore. If you want to autmate it completely just export your credentials before running the script. The script can be found here.
https://github.com/tiiiecherle/osx_install_config/blob/master/05_homebrew_and_casks/5b_homebrew_cask/6_mas_appstore.sh
Be sure to download the complete folder 05_homebrew_and_casks and run the script from there without deleting the other scripts as it uses other scripts in the directory to check and define variables and components of the script to avoid redundant code in the other scripts in the same directory.
Hope it helps anyone ;)
How do I integrate the automated App Store login into an already existing script? I'm working on scripting deployments to help make my job a little easier. A specific department requires Xcode and other plugins via brew, so I wrote a basic script to install the plugins and (hopefully) Xcode.
Hey, first of all thanks for this project, I really like it. Regarding the not working install via mas on the command line I came up with a workaround until another solution can be found. I maintain a github project which aims at automating install, customization and updates of macos. You can find it here: https://github.com/tiiiecherle/osx_install_config As part of homebrew install scrips I added a bash script that installs mas, opens the appstore via applescript and enters apple-id and password before closing the appstore to automate the complete process. The script prompts you for your credentials to use it later in the appstore. If you want to autmate it completely just export your credentials before running the script. The script can be found here. https://github.com/tiiiecherle/osx_install_config/blob/master/05_homebrew_and_casks/5b_homebrew_cask/6_mas_appstore.sh Be sure to download the complete folder 05_homebrew_and_casks and run the script from there without deleting the other scripts as it uses other scripts in the directory to check and define variables and components of the script to avoid redundant code in the other scripts in the same directory. Hope it helps anyone ;)
How do I integrate the automated App Store login into an already existing script? I'm working on scripting deployments to help make my job a little easier. A specific department requires Xcode and other plugins via brew, so I wrote a basic script to install the plugins and (hopefully) Xcode.
Just copy the respective variables, functions and parts of ~~https://github.com/tiiiecherle/osx_install_config/blob/master/05_homebrew_and_casks/5b_homebrew_cask/6_mas_appstore.sh~~ to your script and it should work.
Link Update due to project restructuring... https://github.com/tiiiecherle/osx_install_config/blob/master/03_homebrew_casks_and_mas/3b_homebrew_casks_and_mas_install/6_mas_appstore.sh
For anyone looking for the login workaround in my script. I restructured my project. In the process the script folder was renamed and the script moved to a new location:
Has anyone looked at this? https://github.com/w0lfschild/macOS_headers/blob/master/macOS/PrivateFrameworks/StoreFoundation/8/ISAccountService-Protocol.h
@Jarli01 yes, this project uses class-dump
as well to generate headers for the private frameworks. See ISAccountService.h
has anyone found a way to do a signin without being able to actually launch the appstore? Its blocked by JamF... mas was working great for me, but i got signed out due to a password change. Now I can't sign back in because my company has decided to block access to the app store.
has anyone found a way to do a signin without being able to actually launch the appstore? Its blocked by JamF... mas was working great for me, but i got signed out due to a password change. Now I can't sign back in because my company has decided to block access to the app store.
+1 here. If you have an option... :(
Ha.
sudo jamf removeMDMProfile
removes all restrictions
sudo jamf manage
brings back all restrictions and profiles
More here and much more here