Closed cmccarthyIrl closed 7 months ago
in kotlin
fun startActivity() {
androidDriver!!.executeScript(
"mobile: startActivity",
mapOf(
"intent" to APP_PACKAGE + "/" + APP_ACTIVITY,
"stop" to "true"
)
)
}
You can also find example usage for any mobile extension command for UiAutomator2 in its readme here.
Thanks @valfirst , @eglitise - I'm following those examples but I'm not able to open the Chrome package in Settings. I can get the Settings app to open on the device but not the Settings > Apps > Chrome
package as expected
Approach 1
String[][] arrayOfArrays = {
{"s", "package", "com.android.chrome"}
};
driver.executeScript("mobile: startActivity",
ImmutableMap.of("intent", "com.android.settings/.applications.InstalledAppDetails", "wait", true, "extras", arrayOfArrays));
Approach 2
driver.executeScript("mobile: startActivity", ImmutableMap.of("intent",
"com.android.settings/.applications.InstalledAppDetails", "wait", true,"package", "com.android.chrome"));
Thanks @mykola-mokhnach, I got it working with the following
driver.executeScript("mobile: startActivity",
ImmutableMap.of( "action", "android.settings.APPLICATION_DETAILS_SETTINGS", "uri",
"package:com.android.chrome"));
Description
After updating my Appium dependency to version 9.1.0, I am no longer able to use ((AndroidDriver) driver).startActivty(activity)
Environment
Details
With Appium version 8.5.1, I was able to start my Android Activity using the following approach:
Activity activity = new Activity("com.android.settings", ".applications.InstalledAppDetails") .setOptionalIntentArguments("package:com.android.chrome"); ((AndroidDriver) DriverManager.getDriver()).startActivity(activity);
How can I launch the
package:com.android.chrome activity
usingmobile: startActivity
?