Skip to content

Commit 4617ac5

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 7c69b30 commit 4617ac5

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
@@ -108,7 +108,7 @@ class ADB {
108108
}
109109

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

0 commit comments

Comments
 (0)