superstar3000
superstar3000

Reputation: 399

How to translate an ADB command line control ---> to MonkeyRunner Python script

When I run this on the command line it brings up the screen on my device to change the language.

$ adb shell am start -a android.settings.LOCALE_SETTINGS

works great.

I am trying the same functionality into a Python script that monkeyrunner calls. How do you translate the above into something that will work with monkeyrunner / python?

e.g. I tried:

device = Monkeyrunner.waitForConnection()
package = 'android.settings'
activity = 'LOCALE_SETTINGS'
runComponent = package + '/' activity

device.startActivity(component=runComponent

This does nothing. No error message. But nothing.

Any suggestions?

Upvotes: 1

Views: 1348

Answers (1)

Alex P.
Alex P.

Reputation: 31716

android.settings.LOCALE_SETTINGS is not a component but an action. You can do either

device.startActivity(action='android.settings.LOCALE_SETTINGS')

or

device.startActivity(component='com.android.settings/com.android.settings.Settings$LocalePickerActivity')

Upvotes: 1

Related Questions