Skip to content

Commit

Permalink
Use first user account on attached Android devices
Browse files Browse the repository at this point in the history
Fixes #4396

This hardcodes the user ID of 0 when fetching the package list on
Android, otherwise it will fail on devices that have multiple users
(devices with the work profile or Samsung Secure Folder (Knox) enabled).
  • Loading branch information
ericswpark committed Mar 24, 2024
1 parent 411b590 commit 7cec13d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion detox/src/devices/common/drivers/android/exec/ADB.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class ADB {
}

async isPackageInstalled(deviceId, packageId) {
const output = await this.shell(deviceId, `pm list packages ${packageId}`);
const output = await this.shell(deviceId, `pm list packages --user 0 ${packageId}`);
const packageRegexp = new RegExp(`^package:${escape.inQuotedRegexp(packageId)}$`, 'm');
const isInstalled = packageRegexp.test(output);

Expand Down

0 comments on commit 7cec13d

Please sign in to comment.