Skip to content

Accept argument for mas region to set the region #75

@elliotweiser

Description

@elliotweiser

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:

  1. Open the App Store
  2. Navigate to the Purchases tab
  3. Select the flag icon in the bottom right corner
  4. Select any Region other than that which is associated with your account.
  5. Run mas signin ...

Follow-up questions

  1. Has anyone else run into this issue?
  2. Does anyone know of a good way to programmatically set the App Store's Region?
  3. 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 😄 .

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions