Skip to content

Commit 6d877ea

Browse files
committed
Use first user account on attached Android devices
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).
1 parent acda420 commit 6d877ea

File tree

1 file changed

+1
-1
lines changed
  • detox/src/devices/common/drivers/android/exec

1 file changed

+1
-1
lines changed

detox/src/devices/common/drivers/android/exec/ADB.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ class ADB {
9696
}
9797

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

0 commit comments

Comments
 (0)