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

Function extention (apk-utils - isAppInstalled) with the ability to indicate user profile id #738

Closed
msochacki opened this issue May 8, 2024 · 0 comments · Fixed by #739

Comments

@msochacki
Copy link

HI, I would like to ask for the possibility of providing a specific profile ID to the isAppInstalled function from the caps settings level if there is more than one profile on the device, especially if one of these profiles has restrictions imposed (e.g. in connection with the company profile).

The call (https://github.com/appium/appium-adb/blob/master/lib/tools/apk-utils.js#L51) should be expanded by "--user userId" where userId is passing from caps options.

Currently, in the example given, it causes the following error

list packages' exited with code 255'; Command output: [AppiumDriver@9141] Exception occurred while executing 'list': [AppiumDriver@9141] java.lang.SecurityException: Shell does not have permission to access user 10 [AppiumDriver@9141] com.android.server.am.ActivityManagerService.handleIncomingUser:15872 android.app.ActivityManager.handleIncomingUser:5132 com.android.server.pm.PackageManagerShellCommand.translateUserId:3733 [AppiumDriver@9141] at com.android.server.am.UserController.handleIncomingUser(UserController.java:2892) [AppiumDriver@9141] at com.android.server.am.ActivityManagerService.handleIncomingUser(ActivityManagerService.java:15872) [AppiumDriver@9141] at android.app.ActivityManager.handleIncomingUser(ActivityManager.java:5132) [AppiumDriver@9141] at com.android.server.pm.PackageManagerShellCommand.translateUserId(PackageManagerShellCommand.java:3733)

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 a pull request may close this issue.

1 participant