Use MAS region from argument or config; affect actual MAS region; accept region changes without dialog
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 12.4k
- Forks
- 299
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 1
Description
Edited
Replace country with region.
Summary
I've been doing some Ansible role/playbook development, with the following goal: automate the complete provisioning/rebuild of my workstation. Since I work primarily on a Mac (OS X v10.12.2), the mas CLI is extremely useful for automatically installing apps distributed through the App Store.
So far, the project is going well. I've been using the jhcook OS X Sierra box for testing with vagrant/virtualbox. However I've encountered a couple issues with using mas when testing.
Invoking the mas signin <USERNAME> <PASSWORD> command, a dialog pops up in the App Store GUI, requiring an acknowledgement of OK that the App Store should go ahead and update the Region according to the signed-in user's Apple account's billing settings. Presumably, this is because the Region is either unset or doesn't match my Apple account's billing settings. The mas CLI is unusable until that dialog has been completed. Below is the complete dialog text:
This Apple ID is only valid for purchases in the U.S. iTunes Store. You will be switched to that Store.
How to reproduce
I believe this can be reproduced with the following steps:
- Open the App Store
- Navigate to the Purchases tab
- Select the flag icon in the bottom right corner
- Select any Region other than that which is associated with your account.
- Run
mas signin ...
Follow-up questions
- Has anyone else run into this issue?
- Does anyone know of a good way to programmatically set the App Store's Region?
- Are there potentially any "bad" ways, such as modifying a plist file that is loaded into the App Store's runtime?
If there are no workarounds, would anyone be willing to implement another CLI command to mas e.g. mas region <region>? It could also be added as a --region option to the mas signin command, as long as setting the region occurs prior to authentication.
Also, since it is my first time reaching out to the developers and maintainers of this project, I'd like to say thank you for reading this issue and working on this project 😄 .
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the mas signin command and the issue's reproduction steps, then determine how the App Store region is currently selected before authentication. The work is complete when a region from an argument or configuration affects the actual MAS region and region changes no longer require the blocking dialog.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- macos, swift
- Domain
- cli, operating-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100