1

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.

1 Answers1

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