How to launch Android native UI settings which are not apk's example settings lockscreen etc?

How do I launch settings on the Android mobile. As this is not a native app, i assume it has no apk’s to specify app package name or activity names…

The activity name for settings depends upon the platform you are on, it could be any of the following

The first is by far the most common.

1 Like

I specified the first one ( as an app package
I then get the following exception:

(Original error: No app set; either start appium with --app or pass in an ‘app’ value in desired capabilities, or set androidPackage to launch pre-existing app on device)

    DesiredCapabilities capabilities=new DesiredCapabilities();
    capabilities.setCapability("deviceName", "Your device Name");
    capabilities.setCapability("appPackage", "");
    capabilities.setCapability("appActivity", ".Settings");

You can specify the app activity with name like:

capabilities.setCapability("appActivity", "");
1 Like


That works

Thank you :))

In android, if I’m already testing an app other than settings, how do I get to the settings without closing and reopening the driver?
With the python uiautomator, I simply called the quick_settings method and then searched for ‘settings’ and clicked that.

Any idea how to open android.settings.DATE_SETTINGS?

I can open it using adb shell, but device farm has no access to the shell so I need to to it using driver.startActivity.

The following does not work:

    val settingsActivity = Activity("", ".Settings\$ActionDateSettings")
    val androidDriver = driver as AndroidDriver