Open Bug 1908765 Opened 1 year ago Updated 6 months ago

Add option to select which user to run adb commands with

Categories

(Firefox for Android :: Tooling, enhancement)

All
Android
enhancement

Tracking

()

People

(Reporter: fkilic, Unassigned)

Details

I tried to run mach install but for some reason adb defaults to some other user.

mozdevice.adb.ADBProcessError: args: /.../.mozbuild/android-sdk-macosx/platform-tools/adb wait-for-device shell pm list package org.mozilla.geckoview_example, exitcode: 255, stdout: 
Exception occurred while executing 'list':
java.lang.SecurityException: Shell does not have permission to access user 150

As a temporary workaround I modified https://searchfox.org/mozilla-central/rev/b220e40ff2ee3d10ce68e07d8a8a577d5558e2a2/testing/mozbase/mozdevice/mozdevice/adb.py#4050 as the following

- "pm list package %s" % app_name, timeout=timeout, enable_run_as=False
+ "pm list package --user 0", timeout=timeout, enable_run_as=False

I couldn't find any way to add --user 0 without removing %s" % app_name.

For additional context, I'm on Samsung S23 Ultra and this is the output I get when I run adb shell pm list users

Users:
	UserInfo{0:Fatih Kilic:some_sort_of_hash} running
	UserInfo{150:Secure Folder:some_sort_of_number} running
You need to log in before you can comment on or make changes to this bug.