1

I'm wondering if there is a way to get the device locale from AWS Device Farm.

I've tried reading the log cat, but the locale set once, so i could only read this info in one test.

I also tried using the driver shell command but in order to do so i need to start the Appium server with --relaxed-security flag and i don't know if passing flags to AWS-Device Farm Appium server is possible.

So, is there a way to get the locale ? or can i set flags to the AWS-Device Farm Appium Server?

1 Answers1

0

The global locale on the device can be retrieved using :

defaultLocale = Resources.getSystem().getConfiguration().getLocales().get(0);

Alternatively, you can also use class Locale: https://developer.android.com/reference/java/util/Locale

Locale.getDefault().getLanguage()

Note: There is a difference between the app locale and global locale on the device so you want to be careful on which one you want to use.

NikofTime
  • 729
  • 3
  • 4
  • Im talking from a Automation perfective where the only way you have to access the "Android Device" is the AppiumDriver – Luis Javier Peña Ureña Aug 01 '18 at 13:22
  • May be one way could be to run an adb command from your Appium test code like: - adb shell getprop | grep language [persist.sys.language]: [en] [ro.product.locale.language]: [en] – NikofTime Aug 15 '18 at 22:11