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

Allow set process id together with bundleID to activate app #310

Open
LykashevichAndrei opened this issue Jul 18, 2024 · 2 comments
Open

Comments

@LykashevichAndrei
Copy link

LykashevichAndrei commented Jul 18, 2024

In a situation where multiple applications with the same bundle identifier (bundleID) are running simultaneously, it would be convenient to have the ability to set the process ID (PID) to connect to the correct application. However, using the application path (appPath) is not always the best option, as this path can also be the same.

@ketai4eg
Copy link

I have a similar issue. We are using two different Python versions, and Appium can't resolve the path correctly. For example, the app is run using Python 3.9, but Appium continues to search for Python at /Library/Frameworks/Python.framework/Versions/3.12/Resources/Python.app. As a result, it's not possible to connect to the app.

@KazuCocoa
Copy link
Member

Do you have any idea how to achieve it...? Current logic to launch an app is via https://developer.apple.com/documentation/xctest/xcuiapplication?language=objc , so I wondered how we could do it.

XCUIApplication *app = [self applicationWithBundleId:bundleIdentifier orPath:path];
if (app.state <= XCUIApplicationStateNotRunning) {
app.launchArguments = arguments ?: @[];
app.launchEnvironment = environment ?: @{};
[app launch];
} else {
[app activate];
}

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

No branches or pull requests

3 participants