I have a problem of an app that open a site every time open the browser. I found the id of the app with this intent by adb and now I'm wondering if there is a way to find the package name by the app id without root permissions.
Asked
Active
Viewed 2,919 times
1 Answers
5
For UnRooted devices following works for me:
Set up adb
in a PC, connect the device to the PC, launch a shell
on the PC and enter:
adb shell "dumpsys package | grep -A1 'userId=UID'"
Replace UID
with the ID
you're looking for, such as 10102
.
Example:
bash-4.2# adb shell "dumpsys package | grep -A1 'userId=10102'"
userId=10102
pkg=Package{46171ce com.android.chrome}
bash-4.2#
The line containing Package{would show the package name of the app in between whitespace and}
. You can do adb shell dumpsys package PKG_NAME (PKG_NAME → package name of an app)
to know more details about that package/app.

Shridutt Kothari
- 7,326
- 3
- 41
- 61
-
Might have to do -A2 in grep, if it's a shared uid e.g. for uid 1000. – nishantsingh Feb 24 '22 at 06:10