I Can't run the activateApp method

Hi everyone,

I close the app with terminateApp during my tests.

((InteractsWithApps) getDriver()).terminateApp(getProps().getProperty("androidAppPackage"));

When I want to open it again with the active App method.

((InteractsWithApps) getDriver()).activateApp(getProps().getProperty("androidAppPackage"));

I am facing this situation on the phone.

I usually have this problem on phones originating from China. Xiomi, Oppo, Huawei etc.

I couldn’t find what caused it and what to do.

Thanks fol helping.

1 Like

Any idea sir, thanks @Aleksei

why not just tap Always? Do you care? Or you need to select your app?

or see the idea from https://stackoverflow.com/questions/19799745/where-is-information-about-default-browser-stored-in-android

same problem here.
trying to activate app, but appium java-client opens “open with” dialog, not an AUT.
how to start AUT?
got problem on HUAWEI Honor 10 Lite
works just fine with emulator.

fixed this with custom activateApp:

    try {
        Map<String, Object> paramsMap = ImmutableMap.of("intent", appName + "/" + appActivity);
        getAndroidDriver().executeScript("mobile: startActivity", paramsMap);
    } catch (WebDriverException e) {
1 Like