Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update activity constants for launching Chrome #913

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ElCamino72
Copy link

Copy link

CLA Not Signed

@@ -15,31 +15,31 @@ import {toDetailsCacheKey, getWebviewDetails, WEBVIEWS_DETAILS_CACHE} from './ca
export const CHROME_BROWSER_PACKAGE_ACTIVITY = /** @type {const} */ ({
chrome: {
pkg: 'com.android.chrome',
activity: 'com.google.android.apps.chrome.Main',
activity: 'com.google.android.apps.chrome.IntentDispatcher',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if it is a good idea to change records. Perhaps, it makes sense to just add new ones

Copy link
Contributor

@mykola-mokhnach mykola-mokhnach Feb 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe it also makes sense to autodetect the activity for the given package name using cmd package resolve-activity --brief <pkg_name> (only works on Android 7+)?

Copy link

@michapringle michapringle Feb 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mykola-mokhnach How do we add new ones (what would the config look like?), and what advantage do we gain from keeping the old ones, assuming that the article https://automationchronicles.com/error-when-opening-chrome-on-android-13-via-adb/ is correct in its assertion that

... no one noticed it because Android was not strict about the filters until now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just try if appium/appium-uiautomator2-driver#730 works for you

Copy link

@michapringle michapringle Feb 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Sure, we will try it. Do you know which release this change will be in?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you don't need to wait for a release. You can simply checkout my branch locally and then install the driver from the local filesystem using --source=local CLI argument.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@KazuCocoa
Copy link
Member

KazuCocoa commented Feb 5, 2024

appium/appium#17492 is a relevant conversation we had before.

The method where uses this const in uia2 just sets the appPackage info as a return value ([update], noticed this was for known packages. https://github.com/appium/appium-android-driver/blob/acaf50709b96e95e05f7b5d0851893407718dea1/lib/commands/context/exports.js#L344C10-L344C31 unknown appPackage referred to the appActivity) so maybe this change is not necessary as Appium's usage, but perhaps it makes sense to use the resolve-activity (personally, but not sure) to show what current active activity is as the response. (?)

Btw, in the past, a new session with below caps succeeded in launching chrome process for Android 13 (if my memory was correct as appium/appium#17492 (comment) ) as well. It could depend on chrome/chromedriver version as well, but perpahs all activity do not need to be IntentDispatcher. Some, or they could depend on the chrome version/OS version etc

"appPackage": "com.android.chrome",
"appActivity": "com.google.android.apps.chrome.Main"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants