3

I need to get the List of apps that are enabled in the Android work Profile/Managed Profile, where My app is the Profile Owner app or alternatively how to check whether the app with given package name is Installed in work Profile/Managed Profile.

sjDroid
  • 159
  • 2
  • 8

1 Answers1

0

Most adb commands provide a --user option.

Get the user with adb shell pm list users

This should output something like:

 Users:     
    UserInfo{0:Owner:13} running
    UserInfo{10:<work profile name>:30} running

In this case the work profile user id is 10.

Now you can get the packages for that work profile with adb shell pm list packages --user 10

https://developer.android.com/work/managed-profiles

https://developer.android.com/studio/command-line/adb#shellcommands

Matt
  • 2,232
  • 8
  • 35
  • 64
  • 1
    can it be checked programatically while running the app? I don't get it how to run shell commands programmatically in app lifecycle. – Mihodi Lushan Oct 22 '20 at 09:54